From 9a005447ef2f6726b2139b0ae4d99cf566ef365b Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 11 May 2024 15:57:05 -0500 Subject: simplify file service --- src/slskd/Files/FileService.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/slskd/Files/FileService.cs') 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 /// /// Manages files on disk. /// - public class FileService : IFileService + public class FileService { /// /// Initializes a new instance of the class. @@ -66,7 +65,7 @@ namespace slskd.Files /// /// Thrown if a specified directory does not exist. /// Thrown if a specified directory is restricted. - public async Task>> DeleteDirectoriesAsync(params string[] directories) + public virtual async Task>> DeleteDirectoriesAsync(params string[] directories) { if (directories.Any(directory => Path.GetFullPath(directory) != directory)) { @@ -129,7 +128,7 @@ namespace slskd.Files /// Thrown if any of the specified files have a relative path. /// Thrown if a specified file does not exist. /// Thrown if a specified file is restricted. - public async Task>> DeleteFilesAsync(params string[] files) + public virtual async Task>> DeleteFilesAsync(params string[] files) { if (files.Any(file => Path.GetFullPath(file) != file)) { @@ -182,7 +181,7 @@ namespace slskd.Files /// Thrown if the specified directory has a relative path. /// Thrown if the specified directory does not exist. /// Thrown if the specified root directory is restricted. - public async Task ListContentsAsync(string directory, EnumerationOptions enumerationOptions = null) + public virtual async Task ListContentsAsync(string directory, EnumerationOptions enumerationOptions = null) { if (Path.GetFullPath(directory) != directory) { -- cgit v1.2.3