Package com.mku.salmonfs.drive.utils
Class AesFileImporter
java.lang.Object
com.mku.fs.drive.utils.FileImporter
com.mku.salmonfs.drive.utils.AesFileImporter
Imports files into an encrypted virtual drive.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.mku.fs.drive.utils.FileImporter
FileImporter.FileImportOptions -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a file importer for encrypted files.AesFileImporter(int bufferSize) Instantiates a file importer for encrypted files.AesFileImporter(int bufferSize, int threads) Instantiates a file importer for encrypted files. -
Method Summary
Modifier and TypeMethodDescriptionprotected longGet the minimum part of file that can be imported in parallel.importFile(IFile fileToImport, IVirtualFile dir) Imports a real file into the drive.importFile(IFile fileToImport, IVirtualFile dir, FileImporter.FileImportOptions options) Imports a real file into the drive.protected voidonPrepare(IVirtualFile targetFile, boolean integrity) Runs before importMethods inherited from class com.mku.fs.drive.utils.FileImporter
close, initialize, isRunning, stop
-
Constructor Details
-
AesFileImporter
public AesFileImporter()Instantiates a file importer for encrypted files. -
AesFileImporter
public AesFileImporter(int bufferSize) Instantiates a file importer for encrypted files.- Parameters:
bufferSize- The buffer size to be used.
-
AesFileImporter
public AesFileImporter(int bufferSize, int threads) Instantiates a file importer for encrypted files.- Parameters:
bufferSize- The buffer size to be used.threads- The parallel threads to use
-
-
Method Details
-
onPrepare
Runs before import- Specified by:
onPreparein classFileImporter- Parameters:
targetFile- The target file importedintegrity- If integrity verification is enabled- Throws:
IOException- If there is a problem with the file preparation.
-
getMinimumPartSize
Get the minimum part of file that can be imported in parallel.- Specified by:
getMinimumPartSizein classFileImporter- Parameters:
file- The file- Returns:
- The number of bytes
- Throws:
IOException- If there was a problem calculating the size.
-
importFile
Imports a real file into the drive.- Overrides:
importFilein classFileImporter- Parameters:
fileToImport- The source file that will be imported in into the drive.dir- The target directory in the drive that the file will be imported- Returns:
- The imported file
- Throws:
Exception- Thrown if error occurs during import
-
importFile
public AesFile importFile(IFile fileToImport, IVirtualFile dir, FileImporter.FileImportOptions options) throws Exception Imports a real file into the drive.- Overrides:
importFilein classFileImporter- Parameters:
fileToImport- The source file that will be imported in into the drive.dir- The target directory in the drive that the file will be importedoptions- The options- Returns:
- The imported file
- Throws:
Exception- Thrown if error occurs during import
-