Package com.mku.utils
Class FileExporter
java.lang.Object
com.mku.utils.FileExporter
- Direct Known Subclasses:
SalmonFileExporter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
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 void
finalize()
protected abstract long
void
initialize
(int bufferSize, int threads) boolean
protected abstract void
onPrepare
(IVirtualFile importedFile, boolean integrity) void
stop()
-
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()
-