Package com.mku.fs.drive.utils
Class FileExporter
java.lang.Object
com.mku.fs.drive.utils.FileExporter
- Direct Known Subclasses:
AesFileExporter
Exports IVirtualFile(s) from a VirtualDrive.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFile importer options -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close exporter and release resources.exportFile(IVirtualFile fileToExport, IFile exportDir) Export a file from the drive to the external directory pathexportFile(IVirtualFile fileToExport, IFile exportDir, FileExporter.FileExportOptions options) Export a file from the drive to the external directory pathprotected abstract longGet the minimum part of file that can be exported in parallel.voidinitialize(int bufferSize, int threads) Initialize the exporter.booleanCheck if export is runningprotected abstract voidonPrepare(IVirtualFile sourceFile, boolean integrity) Runs before exportvoidstop()Stop current export
-
Constructor Details
-
FileExporter
public FileExporter()
-
-
Method Details
-
onPrepare
Runs before export- Parameters:
sourceFile- The file that will be 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 exported in parallel.- Parameters:
file- The file- Returns:
- The number of bytes
- Throws:
IOException- If there was a problem calculating the size.
-
initialize
public void initialize(int bufferSize, int threads) Initialize the exporter.- Parameters:
bufferSize- The buffer size to use while exportingthreads- The number of parallel threads to run
-
isRunning
public boolean isRunning()Check if export is running- Returns:
- True if running
-
stop
public void stop()Stop current export -
exportFile
Export a file from the drive to the external directory path- Parameters:
fileToExport- The file that will be exportedexportDir- The external directory the file will be exported to- Returns:
- The exported file
- Throws:
Exception- Thrown if error occurs during export
-
exportFile
public IFile exportFile(IVirtualFile fileToExport, IFile exportDir, FileExporter.FileExportOptions options) throws Exception Export a file from the drive to the external directory path- Parameters:
fileToExport- The file that will be exportedexportDir- The external directory the file will be exported tooptions- The options- Returns:
- The exported file
- Throws:
Exception- Thrown if error occurs during export
-
close
public void close()Close exporter and release resources.
-