Package com.mku.salmonfs.drive.utils
Class AesFileImporter
- java.lang.Object
-
- com.mku.fs.drive.utils.FileImporter
-
- com.mku.salmonfs.drive.utils.AesFileImporter
-
public class AesFileImporter extends FileImporter
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
Constructors Constructor Description AesFileImporter()Instantiates 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected longgetMinimumPartSize(IVirtualFile file)Get the minimum part of file that can be imported in parallel.AesFileimportFile(IFile fileToImport, IVirtualFile dir)Imports a real file into the drive.AesFileimportFile(IFile fileToImport, IVirtualFile dir, FileImporter.FileImportOptions options)Imports a real file into the drive.protected voidonPrepare(IVirtualFile targetFile, boolean integrity)Runs before import-
Methods inherited from class com.mku.fs.drive.utils.FileImporter
close, initialize, isRunning, stop
-
-
-
-
Constructor Detail
-
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 Detail
-
onPrepare
protected void onPrepare(IVirtualFile targetFile, boolean integrity) throws java.io.IOException
Runs before import- Specified by:
onPreparein classFileImporter- Parameters:
targetFile- The target file importedintegrity- If integrity verification is enabled- Throws:
java.io.IOException- If there is a problem with the file preparation.
-
getMinimumPartSize
protected long getMinimumPartSize(IVirtualFile file) throws java.io.IOException
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:
java.io.IOException- If there was a problem calculating the size.
-
importFile
public AesFile importFile(IFile fileToImport, IVirtualFile dir) throws java.lang.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 imported- Returns:
- The imported file
- Throws:
java.lang.Exception- Thrown if error occurs during import
-
importFile
public AesFile importFile(IFile fileToImport, IVirtualFile dir, FileImporter.FileImportOptions options) throws java.lang.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:
java.lang.Exception- Thrown if error occurs during import
-
-