diff options
| author | JP Dillingham <jp@dillingham.me> | 2024-05-11 17:19:21 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2024-05-11 17:19:21 -0500 |
| commit | 18d3d2328e83f690220db90fbb1b0718492e20b5 (patch) | |
| tree | bb807fccddc30e4c619be6d0dd52145b32e3a63f /src/slskd/Files/FileService.cs | |
| parent | 28c2c7cbe76b215c605e1b510cee34270596cf27 (diff) | |
| parent | ff841bc6411be74e99b0b71754d23614a59c7187 (diff) | |
| download | slskd-18d3d2328e83f690220db90fbb1b0718492e20b5.tar.gz | |
Merge remote-tracking branch 'origin/master' into file-perms
Diffstat (limited to 'src/slskd/Files/FileService.cs')
| -rw-r--r-- | src/slskd/Files/FileService.cs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/slskd/Files/FileService.cs b/src/slskd/Files/FileService.cs index c820220f..ee8271b1 100644 --- a/src/slskd/Files/FileService.cs +++ b/src/slskd/Files/FileService.cs @@ -23,7 +23,6 @@ namespace slskd.Files using System.Collections.Generic; using System.IO; using System.Linq; - using System.Security; using System.Threading.Tasks; using OneOf; using Serilog; @@ -31,7 +30,7 @@ namespace slskd.Files /// <summary> /// Manages files on disk. /// </summary> - public class FileService : IFileService + public class FileService { /// <summary> /// Initializes a new instance of the <see cref="FileService"/> class. @@ -66,7 +65,7 @@ namespace slskd.Files /// </exception> /// <exception cref="NotFoundException">Thrown if a specified directory does not exist.</exception> /// <exception cref="UnauthorizedException">Thrown if a specified directory is restricted.</exception> - public async Task<Dictionary<string, OneOf<bool, Exception>>> DeleteDirectoriesAsync(params string[] directories) + public virtual async Task<Dictionary<string, OneOf<bool, Exception>>> DeleteDirectoriesAsync(params string[] directories) { if (directories.Any(directory => Path.GetFullPath(directory) != directory)) { @@ -129,7 +128,7 @@ namespace slskd.Files /// <exception cref="ArgumentException">Thrown if any of the specified files have a relative path.</exception> /// <exception cref="NotFoundException">Thrown if a specified file does not exist.</exception> /// <exception cref="UnauthorizedException">Thrown if a specified file is restricted.</exception> - public async Task<Dictionary<string, OneOf<bool, Exception>>> DeleteFilesAsync(params string[] files) + public virtual async Task<Dictionary<string, OneOf<bool, Exception>>> DeleteFilesAsync(params string[] files) { if (files.Any(file => Path.GetFullPath(file) != file)) { @@ -182,7 +181,7 @@ namespace slskd.Files /// <exception cref="ArgumentException">Thrown if the specified directory has a relative path.</exception> /// <exception cref="NotFoundException">Thrown if the specified directory does not exist.</exception> /// <exception cref="UnauthorizedException">Thrown if the specified root directory is restricted.</exception> - public async Task<FilesystemDirectory> ListContentsAsync(string directory, EnumerationOptions enumerationOptions = null) + public virtual async Task<FilesystemDirectory> ListContentsAsync(string directory, EnumerationOptions enumerationOptions = null) { if (Path.GetFullPath(directory) != directory) { |
