Package com.mku.salmon.utils
Class SalmonFileImporter
java.lang.Object
com.mku.utils.FileImporter
com.mku.salmon.utils.SalmonFileImporter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected long
importFile
(IRealFile fileToImport, IVirtualFile dir, String filename, boolean deleteSource, boolean integrity, BiConsumer<Long, Long> onProgress) Imports a real file into the drive.protected void
onPrepare
(IVirtualFile importedFile, boolean integrity) Methods inherited from class com.mku.utils.FileImporter
close, finalize, initialize, isRunning, stop
-
Constructor Details
-
SalmonFileImporter
public SalmonFileImporter(int bufferSize, int threads)
-
-
Method Details
-
onPrepare
- Specified by:
onPrepare
in classFileImporter
- Throws:
IOException
-
getMinimumPartSize
- Specified by:
getMinimumPartSize
in classFileImporter
- Throws:
IOException
-
importFile
public SalmonFile importFile(IRealFile fileToImport, IVirtualFile dir, String filename, boolean deleteSource, boolean integrity, BiConsumer<Long, Long> onProgress) throws ExceptionDescription copied from class:FileImporter
Imports a real file into the drive.- Overrides:
importFile
in classFileImporter
- Parameters:
fileToImport
- The source file that will be imported in to the drive.dir
- The target directory in the drive that the file will be importedfilename
- The filename to usedeleteSource
- If true delete the source file.integrity
- Apply data integrityonProgress
- Progress to notify- Returns:
- The imported file
- Throws:
Exception
- Thrown if error occurs during import
-