FileOperationProvider
public protocol FileOperationProvider
Abstract layer of core features for working with local files.
-
Local file directory manager supported by the system
Declaration
Swift
associatedtype DirectoryManager : FileDirectoryOperationProvider -
Undocumented
Declaration
Swift
var directoryManager: DirectoryManager { get } -
Create
FileOperationProviderwith providedDirectoryManagerDeclaration
Swift
init(directoryManager: DirectoryManager) -
save(contentsOf:Default implementationwith: ) Saaved given file data in local file sytem
Throws
Throws:
- When data is not valid (nil or empty)
Default Implementation
Declaration
Swift
func save(contentsOf data: Data?, with name: String) throws -> FileItemParameters
contentsOfdata object, that needs to be saved
withName used for saving data as file
Return Value
Saved
FileItem -
getFile(at:Default implementation) Fetches the file at given location
Throws
Throws:
- When file is not found
- When file is not accessible
- When provided url is not a file location
Default Implementation
Declaration
Swift
func getFile(at location: URL) throws -> FileItemParameters
atLocation, used for fetching the file
Return Value
Fetched
FileItem -
deleteFile(at:Default implementation) Deletes the file at given location
Throws
Throws:
- When file is not found
- When file is not accessible
- When provided url is not a file location
Default Implementation
Declaration
Swift
func deleteFile(at location: URL) throwsParameters
atLocation, used for deleting the file
Return Value
Fetched
FileItem
View on GitHub
FileOperationProvider Protocol Reference