wasDAVClient – Blame information for rev 5

Subversion Repositories:
Rev:
Rev Author Line No. Line
5 office 1 ///////////////////////////////////////////////////////////////////////////
2 // Copyright (C) Wizardry and Steamworks 2016 - License: GNU GPLv3 //
3 // Please see: http://www.gnu.org/licenses/gpl.html for legal details, //
4 // rights of fair usage, the disclaimer and warranty conditions. //
5 ///////////////////////////////////////////////////////////////////////////
6 // Originally based on: WebDAV .NET client by Sergey Kazantsev
7  
1 office 8 using System.Collections.Generic;
9 using System.IO;
10 using System.Threading.Tasks;
11 using wasDAVClient.Model;
12  
13 namespace wasDAVClient
14 {
15 public interface IClient
16 {
17 /// <summary>
3 office 18 /// Specify the WebDAV hostname (required).
1 office 19 /// </summary>
20 string Server { get; set; }
21  
22 /// <summary>
3 office 23 /// Specify the path of a WebDAV directory to use as 'root' (default: /)
1 office 24 /// </summary>
25 string BasePath { get; set; }
26  
27 /// <summary>
3 office 28 /// Specify an port (default: null = auto-detect)
1 office 29 /// </summary>
30 int? Port { get; set; }
31  
32 /// <summary>
3 office 33 /// Specify the UserAgent (and UserAgent version) string to use in requests
1 office 34 /// </summary>
35 string UserAgent { get; set; }
3 office 36  
1 office 37 /// <summary>
3 office 38 /// Specify the UserAgent (and UserAgent version) string to use in requests
1 office 39 /// </summary>
40 string UserAgentVersion { get; set; }
41  
42  
43 /// <summary>
3 office 44 /// List all files present on the server.
1 office 45 /// </summary>
46 /// <param name="path">List only files in this path</param>
47 /// <param name="depth">Recursion depth</param>
48 /// <returns>A list of files (entries without a trailing slash) and directories (entries with a trailing slash)</returns>
49 Task<IEnumerable<Item>> List(string path = "/", int? depth = 1);
50  
51 /// <summary>
3 office 52 /// Get folder information from the server.
1 office 53 /// </summary>
54 /// <returns>A list of files (entries without a trailing slash) and directories (entries with a trailing slash)</returns>
55 Task<Item> GetFolder(string path = "/");
56  
57 /// <summary>
3 office 58 /// Get file information from the server.
1 office 59 /// </summary>
60 /// <returns>A list of files (entries without a trailing slash) and directories (entries with a trailing slash)</returns>
61 Task<Item> GetFile(string path = "/");
62  
63 /// <summary>
3 office 64 /// Download a file from the server
1 office 65 /// </summary>
66 /// <param name="remoteFilePath">Source path and filename of the file on the server</param>
67 Task<Stream> Download(string remoteFilePath);
68  
69 /// <summary>
3 office 70 /// Download a file from the server
1 office 71 /// </summary>
72 /// <param name="remoteFilePath">Source path and filename of the file on the server</param>
73 /// <param name="content"></param>
74 /// <param name="name"></param>
75 Task<bool> Upload(string remoteFilePath, Stream content, string name);
76  
77 /// <summary>
3 office 78 /// Create a directory on the server
1 office 79 /// </summary>
80 /// <param name="remotePath">Destination path of the directory on the server</param>
81 /// <param name="name"></param>
82 Task<bool> CreateDir(string remotePath, string name);
83  
84 /// <summary>
3 office 85 /// Get folder information from the server.
1 office 86 /// </summary>
87 /// <returns>A list of files (entries without a trailing slash) and directories (entries with a trailing slash)</returns>
88 Task DeleteFolder(string path = "/");
89  
90 /// <summary>
3 office 91 /// Get file information from the server.
1 office 92 /// </summary>
93 /// <returns>A list of files (entries without a trailing slash) and directories (entries with a trailing slash)</returns>
94 Task DeleteFile(string path = "/");
95  
96 /// <summary>
3 office 97 /// Move a folder on the server
1 office 98 /// </summary>
99 /// <param name="srcFolderPath">Source path of the folder on the server</param>
100 /// <param name="dstFolderPath">Destination path of the folder on the server</param>
101 Task<bool> MoveFolder(string srcFolderPath, string dstFolderPath);
102  
103 /// <summary>
3 office 104 /// Move a file on the server
1 office 105 /// </summary>
106 /// <param name="srcFilePath">Source path and filename of the file on the server</param>
107 /// <param name="dstFilePath">Destination path and filename of the file on the server</param>
108 Task<bool> MoveFile(string srcFilePath, string dstFilePath);
109 }
110 }