2025-01-11 01:26:26 +01:00
|
|
|
import Foundation
|
|
|
|
|
2025-01-11 03:24:22 +01:00
|
|
|
public protocol FileServicing {
|
2025-01-11 01:26:26 +01:00
|
|
|
|
2025-01-11 03:24:22 +01:00
|
|
|
// MARK: Computed
|
2025-01-11 01:26:26 +01:00
|
|
|
|
|
|
|
var currentFolder: URL { get async }
|
|
|
|
|
2025-01-11 03:24:22 +01:00
|
|
|
// MARK: Functions
|
|
|
|
|
|
|
|
func exists(at url: URL) async throws (FileServiceError) -> Bool
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// MARK: - Errors
|
|
|
|
|
|
|
|
public enum FileServiceError: Error, Equatable {
|
|
|
|
case folderNotCreated
|
|
|
|
case folderNotDeleted
|
|
|
|
case urlAlreadyExists
|
|
|
|
case urlNotExists
|
|
|
|
case urlNotFileURL
|
2025-01-11 01:26:26 +01:00
|
|
|
}
|