/wasDAVClient/IClient.cs |
@@ -1,10 +1,3 @@ |
/////////////////////////////////////////////////////////////////////////// |
// 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; |
@@ -15,58 +8,58 @@ |
public interface IClient |
{ |
/// <summary> |
/// Specify the WebDAV hostname (required). |
/// Specify the WebDAV hostname (required). |
/// </summary> |
string Server { get; set; } |
|
/// <summary> |
/// Specify the path of a WebDAV directory to use as 'root' (default: /) |
/// Specify the path of a WebDAV directory to use as 'root' (default: /) |
/// </summary> |
string BasePath { get; set; } |
|
/// <summary> |
/// Specify an port (default: null = auto-detect) |
/// Specify an port (default: null = auto-detect) |
/// </summary> |
int? Port { get; set; } |
|
/// <summary> |
/// Specify the UserAgent (and UserAgent version) string to use in requests |
/// Specify the UserAgent (and UserAgent version) string to use in requests |
/// </summary> |
string UserAgent { get; set; } |
|
/// <summary> |
/// Specify the UserAgent (and UserAgent version) string to use in requests |
/// Specify the UserAgent (and UserAgent version) string to use in requests |
/// </summary> |
string UserAgentVersion { get; set; } |
|
string UserAgentVersion { get; set; } |
|
|
/// <summary> |
/// List all files present on the server. |
/// List all files present on the server. |
/// </summary> |
/// <param name="path">List only files in this path</param> |
/// <param name="depth">Recursion depth</param> |
/// <returns>A list of files (entries without a trailing slash) and directories (entries with a trailing slash)</returns> |
Task<IEnumerable<Item>> List(string path = Constants.DIRECTORY_SEPARATOR, string depth = Constants.DavDepth.MEMBERS); |
Task<IEnumerable<Item>> List(string path = "/", int? depth = 1); |
|
/// <summary> |
/// Get folder information from the server. |
/// Get folder information from the server. |
/// </summary> |
/// <returns>A list of files (entries without a trailing slash) and directories (entries with a trailing slash)</returns> |
Task<Item> GetFolder(string path = Constants.DIRECTORY_SEPARATOR); |
Task<Item> GetFolder(string path = "/"); |
|
/// <summary> |
/// Get file information from the server. |
/// Get file information from the server. |
/// </summary> |
/// <returns>A list of files (entries without a trailing slash) and directories (entries with a trailing slash)</returns> |
Task<Item> GetFile(string path = Constants.DIRECTORY_SEPARATOR); |
Task<Item> GetFile(string path = "/"); |
|
/// <summary> |
/// Download a file from the server |
/// Download a file from the server |
/// </summary> |
/// <param name="remoteFilePath">Source path and filename of the file on the server</param> |
Task<Stream> Download(string remoteFilePath); |
|
/// <summary> |
/// Download a file from the server |
/// Download a file from the server |
/// </summary> |
/// <param name="remoteFilePath">Source path and filename of the file on the server</param> |
/// <param name="content"></param> |
@@ -74,7 +67,7 @@ |
Task<bool> Upload(string remoteFilePath, Stream content, string name); |
|
/// <summary> |
/// Create a directory on the server |
/// Create a directory on the server |
/// </summary> |
/// <param name="remotePath">Destination path of the directory on the server</param> |
/// <param name="name"></param> |
@@ -81,19 +74,19 @@ |
Task<bool> CreateDir(string remotePath, string name); |
|
/// <summary> |
/// Get folder information from the server. |
/// Get folder information from the server. |
/// </summary> |
/// <returns>A list of files (entries without a trailing slash) and directories (entries with a trailing slash)</returns> |
Task DeleteFolder(string path = Constants.DIRECTORY_SEPARATOR); |
Task DeleteFolder(string path = "/"); |
|
/// <summary> |
/// Get file information from the server. |
/// Get file information from the server. |
/// </summary> |
/// <returns>A list of files (entries without a trailing slash) and directories (entries with a trailing slash)</returns> |
Task DeleteFile(string path = Constants.DIRECTORY_SEPARATOR); |
Task DeleteFile(string path = "/"); |
|
/// <summary> |
/// Move a folder on the server |
/// Move a folder on the server |
/// </summary> |
/// <param name="srcFolderPath">Source path of the folder on the server</param> |
/// <param name="dstFolderPath">Destination path of the folder on the server</param> |
@@ -100,10 +93,10 @@ |
Task<bool> MoveFolder(string srcFolderPath, string dstFolderPath); |
|
/// <summary> |
/// Move a file on the server |
/// Move a file on the server |
/// </summary> |
/// <param name="srcFilePath">Source path and filename of the file on the server</param> |
/// <param name="dstFilePath">Destination path and filename of the file on the server</param> |
Task<bool> MoveFile(string srcFilePath, string dstFilePath); |
} |
} |
} |