/////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2016 - License: GNU GPLv3 // // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // // rights of fair usage, the disclaimer and warranty conditions. // /////////////////////////////////////////////////////////////////////////// // Originally based on: WebDAV .NET client by Sergey Kazantsev using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using wasDAVClient.Model; namespace wasDAVClient { public interface IClient { /// /// Specify the WebDAV hostname (required). /// string Server { get; set; } /// /// Specify the path of a WebDAV directory to use as 'root' (default: /) /// string BasePath { get; set; } /// /// Specify an port (default: null = auto-detect) /// int? Port { get; set; } /// /// Specify the UserAgent (and UserAgent version) string to use in requests /// string UserAgent { get; set; } /// /// Specify the UserAgent (and UserAgent version) string to use in requests /// string UserAgentVersion { get; set; } /// /// List all files present on the server. /// /// List only files in this path /// Recursion depth /// A list of files (entries without a trailing slash) and directories (entries with a trailing slash) Task> List(string path = Constants.DIRECTORY_SEPARATOR, string depth = Constants.DavDepth.MEMBERS); /// /// Get folder information from the server. /// /// A list of files (entries without a trailing slash) and directories (entries with a trailing slash) Task GetFolder(string path = Constants.DIRECTORY_SEPARATOR); /// /// Get file information from the server. /// /// A list of files (entries without a trailing slash) and directories (entries with a trailing slash) Task GetFile(string path = Constants.DIRECTORY_SEPARATOR); /// /// Download a file from the server /// /// Source path and filename of the file on the server Task Download(string remoteFilePath); /// /// Download a file from the server /// /// Source path and filename of the file on the server /// /// Task Upload(string remoteFilePath, Stream content, string name); /// /// Create a directory on the server /// /// Destination path of the directory on the server /// Task CreateDir(string remotePath, string name); /// /// Get folder information from the server. /// /// A list of files (entries without a trailing slash) and directories (entries with a trailing slash) Task DeleteFolder(string path = Constants.DIRECTORY_SEPARATOR); /// /// Get file information from the server. /// /// A list of files (entries without a trailing slash) and directories (entries with a trailing slash) Task DeleteFile(string path = Constants.DIRECTORY_SEPARATOR); /// /// Move a folder on the server /// /// Source path of the folder on the server /// Destination path of the folder on the server Task MoveFolder(string srcFolderPath, string dstFolderPath); /// /// Move a file on the server /// /// Source path and filename of the file on the server /// Destination path and filename of the file on the server Task MoveFile(string srcFilePath, string dstFilePath); } }