An implementation for OpenCollaborationService (OCS) client
- for use with e.g. OwnCloud, NextCloud
- for .NET Standard 2.0 incl. .Net Core + .Net Framework
Access and manage OwnCloud and NextCloud servers through WebDAV and the OwnCloud/NextCloud OCS API
- OCS API v1.7: https://www.freedesktop.org/wiki/Specifications/open-collaboration-services-1.7/
- OCS NextCloud API: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/index.html#
- OCS OwnCloud API: https://doc.owncloud.com/server/latest/developer_manual/core/apis/ocs-share-api.html
Current code base has been tested to work on:
- OwnCloud 10
- NextCloud 23
The project is a .Net Standard 2.0 class library and it should work on .Net and Mono/Xamarin.
staticvoidShowLoggedInEnvironment(){OcsClientc=newOcsClient("serverurl","username","password");System.Console.WriteLine("## Instance");System.Console.WriteLine("BaseUrl="+c.BaseUrl);System.Console.WriteLine("WebDavBaseUrl="+c.WebDavBaseUrl);System.Console.WriteLine();System.Console.WriteLine("## User");System.Console.WriteLine(c.AuthorizedUserID);System.Console.WriteLine();System.Console.WriteLine("## Config");System.Console.WriteLine("website="+c.GetConfig().Website);System.Console.WriteLine("Host="+c.GetConfig().Host);System.Console.WriteLine("Ssl="+c.GetConfig().Ssl);System.Console.WriteLine("Contact="+c.GetConfig().Contact);System.Console.WriteLine("Version="+c.GetConfig().Version);}staticvoidShowLoggedInUserInfo(){OcsClientc=newOcsClient("serverurl","username","password");varuser=c.GetUserAttributes("username");System.Console.WriteLine("EMail="+user.EMail);System.Console.WriteLine("DisplayName="+user.DisplayName);System.Console.WriteLine("Enabled="+user.Enabled);System.Console.WriteLine("Quota.Total="+user.Quota.Total);System.Console.WriteLine("Quota.Used="+user.Quota.Used);System.Console.WriteLine("Quota.Free="+user.Quota.Free);System.Console.WriteLine("Quota.Relative="+user.Quota.Relative);}usingSystem.IO;usingSystem.Reflection;namespaceCompuMaster.Ocs.DemoApp{classProgram{staticvoidMain(string[]args){stringpath=Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);varc=newOcsClient("https://cloud.server/","uploaduser","uploadpassword");varde=c.Download("/5K_Wallpaper_9.png");using(varfileStream=newFileStream(path+"\\5K_Wallpaper_9.png",FileMode.Create,FileAccess.Write)){de.CopyTo(fileStream);}Streamfs=File.OpenRead(path+"\\5K_Wallpaper_9.png");c.Upload("/Zafer.png",fs);varps=c.ShareWithLink("/Zafer.png");}}}- Bastian Noffer ( @bnoffer ) for his initial owncloud-sharp development at https://github.com/bnoffer/owncloud-sharp
- ZaferGokhan ( https://github.com/ZaferGokhan ) for his .Net Core/.Net 5 support at https://github.com/ZaferGokhan/owncloud-sharp
- Jochen Wezel ( https://github.com/jochenwezel ), CompuMaster GmbH for his dependency updates (especially RestSharp), NuGet publishing and continued support