Package com.mku.utils
Class FileExporter
java.lang.Object
com.mku.utils.FileExporter
- Direct Known Subclasses:
SalmonFileExporter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()exportFile(IVirtualFile fileToExport, IRealFile exportDir, String filename, boolean deleteSource, boolean integrity, BiConsumer<Long, Long> onProgress) Export a file from the drive to the external directory pathprotected voidfinalize()protected abstract longvoidinitialize(int bufferSize, int threads) booleanprotected abstract voidonPrepare(IVirtualFile importedFile, boolean integrity) voidstop()
-
Constructor Details
-
FileExporter
public FileExporter()
-
-
Method Details
-
onPrepare
- Throws:
IOException
-
getMinimumPartSize
- Throws:
IOException
-
initialize
public void initialize(int bufferSize, int threads) -
isRunning
public boolean isRunning() -
stop
public void stop() -
exportFile
public IRealFile exportFile(IVirtualFile fileToExport, IRealFile exportDir, String filename, boolean deleteSource, boolean integrity, BiConsumer<Long, Long> onProgress) throws ExceptionExport 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 tofilename- The filename to usedeleteSource- Delete the source file when the export finishes successfullyintegrity- True to verify integrityonProgress- Progress listener- Returns:
- The exported file
- Throws:
Exception- Thrown if error occurs during export
-
finalize
protected void finalize() -
close
public void close()
-