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