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.
  • Constructor Details

    • 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 Details

    • onPrepare

      protected void onPrepare(IVirtualFile targetFile, boolean integrity) throws IOException
      Runs before import
      Specified by:
      onPrepare in class FileImporter
      Parameters:
      targetFile - The target file imported
      integrity - If integrity verification is enabled
      Throws:
      IOException - If there is a problem with the file preparation.
    • getMinimumPartSize

      protected long getMinimumPartSize(IVirtualFile file) throws IOException
      Get the minimum part of file that can be imported in parallel.
      Specified by:
      getMinimumPartSize in class FileImporter
      Parameters:
      file - The file
      Returns:
      The number of bytes
      Throws:
      IOException - If there was a problem calculating the size.
    • importFile

      public AesFile importFile(IFile fileToImport, IVirtualFile dir) throws Exception
      Imports a real file into the drive.
      Overrides:
      importFile in class FileImporter
      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:
      Exception - Thrown if error occurs during import
    • importFile

      public AesFile importFile(IFile fileToImport, IVirtualFile dir, FileImporter.FileImportOptions options) throws Exception
      Imports a real file into the drive.
      Overrides:
      importFile in class FileImporter
      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
      options - The options
      Returns:
      The imported file
      Throws:
      Exception - Thrown if error occurs during import