diff options
| author | JP Dillingham <jp@dillingham.me> | 2023-06-20 09:12:42 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2023-06-20 09:12:42 -0500 |
| commit | 5e9c7f4a4ba0f20ded6133b763cf0d0132fb7caa (patch) | |
| tree | 90973e2320c2b463871943c327395b28d5a31cf6 /src/slskd/Files/IFileService.cs | |
| parent | e2451a8c1207566851c0baad99a78093441445ae (diff) | |
| download | slskd-5e9c7f4a4ba0f20ded6133b763cf0d0132fb7caa.tar.gz | |
implement file service
Diffstat (limited to 'src/slskd/Files/IFileService.cs')
| -rw-r--r-- | src/slskd/Files/IFileService.cs | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/slskd/Files/IFileService.cs b/src/slskd/Files/IFileService.cs index a02f7a79..d8174d88 100644 --- a/src/slskd/Files/IFileService.cs +++ b/src/slskd/Files/IFileService.cs @@ -27,21 +27,26 @@ namespace slskd.Files public interface IFileService { /// <summary> - /// Recursively lists all of the files in the downloads directory, starting from the optional <paramref name="parentDirectory"/>, and - /// optionally applying the specified <paramref name="enumerationOptions"/>. + /// Lists all of the directories in the specified <paramref name="parentDirectory"/>, optionally applying the + /// specified <paramref name="enumerationOptions"/>. /// </summary> - /// <param name="parentDirectory">An optional parent directory from which to begin searching.</param> + /// <param name="parentDirectory">The directory from which to start the listing.</param> /// <param name="enumerationOptions">Optional enumeration options to apply.</param> - /// <returns>The list of found files.</returns> - Task<IEnumerable<FileInfo>> ListDownloadedFiles(string parentDirectory = null, EnumerationOptions enumerationOptions = null); + /// <returns>The list of found directories.</returns> + /// <exception cref="InvalidDirectoryException"> + /// Thrown if the specified directory is not rooted in an allowed directory. + /// </exception> + Task<IEnumerable<DirectoryInfo>> ListDirectoriesAsync(string parentDirectory, EnumerationOptions enumerationOptions = null); /// <summary> - /// Recursively lists all of the files in the incomplete directory, starting from the optional <paramref name="parentDirectory"/>, and - /// optionally applying the specified <paramref name="enumerationOptions"/>. + /// Lists all of the files in the specified <paramref name="parentDirectory"/>, optionally applying the specified <paramref name="enumerationOptions"/>. /// </summary> /// <param name="parentDirectory">An optional parent directory from which to begin searching.</param> /// <param name="enumerationOptions">Optional enumeration options to apply.</param> /// <returns>The list of found files.</returns> - Task<IEnumerable<FileInfo>> ListIncompleteFiles(string parentDirectory = null, EnumerationOptions enumerationOptions = null); + /// <exception cref="InvalidDirectoryException"> + /// Thrown if the specified directory is not rooted in an allowed directory. + /// </exception> + Task<IEnumerable<FileInfo>> ListFilesAsync(string parentDirectory, EnumerationOptions enumerationOptions = null); } -} +}
\ No newline at end of file |
