Class AesFileImporter


  • public class AesFileImporter
    extends FileImporter
    Imports files into an encrypted virtual drive.
    • Constructor Detail

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

      • onPrepare

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

        protected long getMinimumPartSize​(IVirtualFile file)
                                   throws java.io.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:
        java.io.IOException - If there was a problem calculating the size.
      • importFile

        public AesFile importFile​(IFile fileToImport,
                                  IVirtualFile dir)
                           throws java.lang.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:
        java.lang.Exception - Thrown if error occurs during import
      • importFile

        public AesFile importFile​(IFile fileToImport,
                                  IVirtualFile dir,
                                  FileImporter.FileImportOptions options)
                           throws java.lang.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:
        java.lang.Exception - Thrown if error occurs during import