Explorer
public class Explorer
Undocumented
-
Singleton of
Explorer
ClassDeclaration
Swift
public static let `default`: Explorer
-
Undocumented
Declaration
Swift
public init(with fileManager: FileProvider = DefaultFileProvider())
-
Undocumented
Declaration
Swift
public var currentDirectoryPath: String { get }
-
Delete File
Declaration
Swift
@discardableResult public func delete(operation: SingleFileOperation) -> Result<SingleFileOperation, Error>
Parameters
operation
Delete operation, will delete spesific file at spesific path with
SingleFileOperation
Return Value
Result
Result<SingleFileOperation, Error>
of the operation. -
Delete Folder
Declaration
Swift
@discardableResult public func delete(operation: SingleFolderOperation) -> Result<SingleFolderOperation, Error>
Parameters
operation
Delete operation, will delete spesific folder at spesific path.
Return Value
Result
Result<SingleFileOperation, Error>
of the operation. -
Write file
Declaration
Swift
@discardableResult public func write(operation: SingleFileOperation, writingStrategy: WriteStrategy = .safe) -> Result<SingleFileOperation, Error>
Parameters
operation
Write Operation, will write spesific to the operation
writingStrategy
how you want the operation to write based on spesific strategy
currentProgressCallback
add your custom action in the middle of the operation (for example, you want to print the current progress operation)
Return Value
Result of the operation.
-
Write files
Declaration
Swift
@discardableResult public func write(operation: BatchFileOperation, writingStrategy: WriteStrategy = .safe) -> Result<BatchFileOperation, Error>
Parameters
operation
Write Operation, will write spesific to the operation
writingStrategy
how you want the operation to write based on spesific strategy
currentProgressCallback
add your custom action in the middle of the operation (for example, you want to print the current progress operation)
Return Value
Result of the operation.
-
Write Folder, define your folder and files, and
Explorer
will create for you.Declaration
Swift
@discardableResult public func write(operation: SingleFolderOperation, writingStrategy: WriteStrategy = .safe) -> Result<SingleFolderOperation, Error>
Parameters
operation
Write Operation, will write spesific to the operation
writingStrategy
how you want the operation to write based on spesific strategy
currentProgressCallback
add your custom action in the middle of the operation (for example, you want to print the current progress operation)
Return Value
Result of the operation.
-
Write Folder, define your folder and files, and
Explorer
will create for you.Declaration
Swift
@discardableResult public func write(operation: BatchFolderOperation, writingStrategy: WriteStrategy = .safe) -> Result<BatchFolderOperation, Error>
Parameters
operation
Write Operation, will write spesific to the operation
writingStrategy
how you want the operation to write based on spesific strategy
currentProgressCallback
add your custom action in the middle of the operation (for example, you want to print the current progress operation)
Return Value
Result of the operation.
-
Check if current path is exist or not
Declaration
Swift
public func isFileExist(path: String) -> Bool
-
Check if current path is file or directory
Declaration
Swift
public func isFile(path: String) -> Result<Bool, Error>
-
Scan directory at path, will return the content inside it
Declaration
Swift
public func list(at path: String, withFolder isFolderIncluded: Bool, isRecursive: Bool) -> Result<[Explorable], Error>
Parameters
path
Path to scan
withFolder
Also Scan folder or not
isRecursive
will include content inside folder
Return Value
Result of Explorables