@@ -50,6 +50,14 @@ public interface IFolder
5050 /// </summary>
5151 string Path { get ; }
5252
53+ /// <summary>
54+ /// Creates a file in this folder
55+ /// </summary>
56+ /// <param name="desiredName">The name of the file to create</param>
57+ /// <param name="option">Specifies how to behave if the specified file already exists</param>
58+ /// <returns>The newly created file</returns>
59+ IFile CreateFile ( string desiredName , CreationCollisionOption option ) ;
60+
5361 /// <summary>
5462 /// Creates a file in this folder
5563 /// </summary>
@@ -59,6 +67,13 @@ public interface IFolder
5967 /// <returns>The newly created file</returns>
6068 Task < IFile > CreateFileAsync ( string desiredName , CreationCollisionOption option , CancellationToken cancellationToken = default ( CancellationToken ) ) ;
6169
70+ /// <summary>
71+ /// Gets a file in this folder
72+ /// </summary>
73+ /// <param name="name">The name of the file to get</param>
74+ /// <returns>The requested file, or null if it does not exist</returns>
75+ IFile GetFile ( string name ) ;
76+
6277 /// <summary>
6378 /// Gets a file in this folder
6479 /// </summary>
@@ -67,13 +82,27 @@ public interface IFolder
6782 /// <returns>The requested file, or null if it does not exist</returns>
6883 Task < IFile > GetFileAsync ( string name , CancellationToken cancellationToken = default ( CancellationToken ) ) ;
6984
85+ /// <summary>
86+ /// Gets a list of the files in this folder
87+ /// </summary>
88+ /// <returns>A list of the files in the folder</returns>
89+ IList < IFile > GetFiles ( ) ;
90+
7091 /// <summary>
7192 /// Gets a list of the files in this folder
7293 /// </summary>
7394 /// <param name="cancellationToken">The cancellation token.</param>
7495 /// <returns>A list of the files in the folder</returns>
7596 Task < IList < IFile > > GetFilesAsync ( CancellationToken cancellationToken = default ( CancellationToken ) ) ;
7697
98+ /// <summary>
99+ /// Creates a subfolder in this folder
100+ /// </summary>
101+ /// <param name="desiredName">The name of the folder to create</param>
102+ /// <param name="option">Specifies how to behave if the specified folder already exists</param>
103+ /// <returns>The newly created folder</returns>
104+ IFolder CreateFolder ( string desiredName , CreationCollisionOption option ) ;
105+
77106 /// <summary>
78107 /// Creates a subfolder in this folder
79108 /// </summary>
@@ -83,6 +112,13 @@ public interface IFolder
83112 /// <returns>The newly created folder</returns>
84113 Task < IFolder > CreateFolderAsync ( string desiredName , CreationCollisionOption option , CancellationToken cancellationToken = default ( CancellationToken ) ) ;
85114
115+ /// <summary>
116+ /// Gets a subfolder in this folder
117+ /// </summary>
118+ /// <param name="name">The name of the folder to get</param>
119+ /// <returns>The requested folder, or null if it does not exist</returns>
120+ IFolder GetFolder ( string name ) ;
121+
86122 /// <summary>
87123 /// Gets a subfolder in this folder
88124 /// </summary>
@@ -91,13 +127,26 @@ public interface IFolder
91127 /// <returns>The requested folder, or null if it does not exist</returns>
92128 Task < IFolder > GetFolderAsync ( string name , CancellationToken cancellationToken = default ( CancellationToken ) ) ;
93129
130+ /// <summary>
131+ /// Gets a list of subfolders in this folder
132+ /// </summary>
133+ /// <returns>A list of subfolders in the folder</returns>
134+ IList < IFolder > GetFolders ( ) ;
135+
94136 /// <summary>
95137 /// Gets a list of subfolders in this folder
96138 /// </summary>
97139 /// <param name="cancellationToken">The cancellation token.</param>
98140 /// <returns>A list of subfolders in the folder</returns>
99141 Task < IList < IFolder > > GetFoldersAsync ( CancellationToken cancellationToken = default ( CancellationToken ) ) ;
100142
143+ /// <summary>
144+ /// Checks whether a folder or file exists at the given location.
145+ /// </summary>
146+ /// <param name="name">The name of the file or folder to check for.</param>
147+ /// <returns>A task whose result is the result of the existence check.</returns>
148+ ExistenceCheckResult CheckExists ( string name ) ;
149+
101150 /// <summary>
102151 /// Checks whether a folder or file exists at the given location.
103152 /// </summary>
@@ -106,11 +155,34 @@ public interface IFolder
106155 /// <returns>A task whose result is the result of the existence check.</returns>
107156 Task < ExistenceCheckResult > CheckExistsAsync ( string name , CancellationToken cancellationToken = default ( CancellationToken ) ) ;
108157
158+ /// <summary>
159+ /// Deletes this folder and all of its contents
160+ /// </summary>
161+ /// <returns>A task which will complete after the folder is deleted</returns>
162+ void Delete ( ) ;
163+
109164 /// <summary>
110165 /// Deletes this folder and all of its contents
111166 /// </summary>
112167 /// <param name="cancellationToken">The cancellation token.</param>
113168 /// <returns>A task which will complete after the folder is deleted</returns>
114169 Task DeleteAsync ( CancellationToken cancellationToken = default ( CancellationToken ) ) ;
170+
171+ /// <summary>
172+ /// Moves this folder and all of its contents to the given folder, current folder will be deleted.
173+ /// </summary>
174+ /// <param name="folder">The folder in which content will be moved</param>
175+ /// <param name="option">Specifies how to behave if the specified folder/file already exists</param>
176+ /// <returns>The folder with moved content.</returns>
177+ IFolder Move ( IFolder folder , NameCollisionOption option = NameCollisionOption . ReplaceExisting ) ;
178+
179+ /// <summary>
180+ /// Moves this folder and all of its contents to the given folder, current folder will be deleted.
181+ /// </summary>
182+ /// <param name="folder">The folder in which content will be moved</param>
183+ /// <param name="option">Specifies how to behave if the specified folder/file already exists</param>
184+ /// <param name="cancellationToken">The cancellation token.</param>
185+ /// <returns>The folder with moved content.</returns>
186+ Task < IFolder > MoveAsync ( IFolder folder , NameCollisionOption option = NameCollisionOption . ReplaceExisting , CancellationToken cancellationToken = default ( CancellationToken ) ) ;
115187 }
116188}
0 commit comments