Package com.mku.utils

Class FileExporter

java.lang.Object
com.mku.utils.FileExporter
Direct Known Subclasses:
SalmonFileExporter

public abstract class FileExporter extends Object
  • Constructor Details

    • FileExporter

      public FileExporter()
  • Method Details

    • onPrepare

      protected abstract void onPrepare(IVirtualFile importedFile, boolean integrity) throws IOException
      Throws:
      IOException
    • getMinimumPartSize

      protected abstract long getMinimumPartSize(IVirtualFile file) throws IOException
      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 Exception
      Export a file from the drive to the external directory path
      Parameters:
      fileToExport - The file that will be exported
      exportDir - The external directory the file will be exported to
      filename - The filename to use
      deleteSource - Delete the source file when the export finishes successfully
      integrity - True to verify integrity
      onProgress - Progress listener
      Returns:
      The exported file
      Throws:
      Exception - Thrown if error occurs during export
    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()