// // Copyright (c) slskd Team. All rights reserved. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published // by the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see https://www.gnu.org/licenses/. // namespace slskd.Files { using System; using System.Collections.Generic; using System.IO; using System.Security; using System.Threading.Tasks; using OneOf; /// /// Manages files on disk. /// public interface IFileService { /// /// Deletes the specified . /// /// /// Returns a dictionary keyed on directory name and containing a result for each specified directory. Exceptions are /// contained in the result, and are not thrown. /// /// The directories to delete. /// The operation context. /// Thrown if any of the specified directories have a relative path. /// /// Thrown if any of the directories is an exact match for an application-controlled directory. /// /// Thrown if a specified directory does not exist. /// Thrown if a specified directory is restricted. Task>> DeleteDirectoriesAsync(params string[] directories); /// /// Deletes the specified . /// /// /// Returns a dictionary keyed on directory name and containing a result for each specified directory. Exceptions are /// contained in the result, and are not thrown. /// /// The list of files to delete. /// The operation context. /// 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. Task>> DeleteFilesAsync(params string[] files); /// /// Lists the contents in the specified , optionally applying the specified . /// /// The directory from which to start the listing. /// Optional enumeration options to apply. /// The list of found contents. /// 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. Task ListContentsAsync(string directory, EnumerationOptions enumerationOptions = null); } }