Package com.mku.salmon.utils
Class SalmonFileCommander
java.lang.Object
com.mku.utils.FileCommander
com.mku.salmon.utils.SalmonFileCommander
Facade class for file operations.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.mku.utils.FileCommander
FileCommander.RealFileTaskProgress, FileCommander.VirtualFileTaskProgress
-
Constructor Summary
ConstructorDescriptionSalmonFileCommander
(int importBufferSize, int exportBufferSize, int threads) Instantiate a new file commander object. -
Method Summary
Modifier and TypeMethodDescriptionimportFiles
(IRealFile[] filesToImport, IVirtualFile importDir, boolean deleteSource, boolean integrity, Consumer<FileCommander.RealFileTaskProgress> onProgressChanged, Function<IRealFile, String> autoRename, BiConsumer<IRealFile, Exception> onFailed) Import files to the drive.Methods inherited from class com.mku.utils.FileCommander
areJobsStopped, cancel, close, copyFiles, deleteFiles, exportFiles, isFileSearcherRunning, isFileSearcherStopped, isRunning, renameFile, search, stopFileSearch
-
Constructor Details
-
SalmonFileCommander
public SalmonFileCommander(int importBufferSize, int exportBufferSize, int threads) Instantiate a new file commander object.- Parameters:
importBufferSize
- The buffer size to use for importing files.exportBufferSize
- The buffer size to use for exporting files.threads
- The threads to use for import and export
-
-
Method Details
-
importFiles
public SalmonFile[] importFiles(IRealFile[] filesToImport, IVirtualFile importDir, boolean deleteSource, boolean integrity, Consumer<FileCommander.RealFileTaskProgress> onProgressChanged, Function<IRealFile, String> autoRename, BiConsumer<IRealFile, throws ExceptionException> onFailed) Description copied from class:FileCommander
Import files to the drive.- Overrides:
importFiles
in classFileCommander
- Parameters:
filesToImport
- The files to import.importDir
- The target directory.deleteSource
- True if you want to delete the source files when import complete.integrity
- True to apply integrity to imported files.onProgressChanged
- Observer to notify when progress changes.autoRename
- Function to rename file if another file with the same filename existsonFailed
- Observer to notify when a file fails importing- Returns:
- The imported files if completes successfully.
- Throws:
Exception
- Thrown if error occurs during import
-