Package com.mku.salmonfs.drive
Class Drive
- java.lang.Object
-
- com.mku.fs.drive.VirtualDrive
-
- com.mku.salmonfs.drive.AesDrive
-
- com.mku.salmonfs.drive.Drive
-
- Direct Known Subclasses:
AndroidDrive
public class Drive extends AesDrive
VirtualDrive implementation for local file systems. Use to store and access encrypted files. To create an instance use static methods open() or create().
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Drive()
Protected constructor, use open() or create() instead.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AesDrive
create(IFile dir, java.lang.String password, INonceSequencer sequencer)
Helper method that creates and initializes a DriveIFile
getPrivateDir()
Get a private dir for sharing files with external applications.AesFile
getRoot()
Return the virtual root directory of the drive.void
onUnlockError()
Called when drive unlock fails.void
onUnlockSuccess()
Called when drive unlock succeeds.static AesDrive
open(IFile dir, java.lang.String password, INonceSequencer sequencer)
Helper method that opens and initializes a Drive-
Methods inherited from class com.mku.salmonfs.drive.AesDrive
close, createConfigFile, createDrive, getAuthConfigFilename, getAuthId, getAuthIdBytes, getBytesFromRealFile, getConfigFile, getConfigFilename, getDefaultAuthConfigFilename, getDefaultFileChunkSize, getDriveConfig, getDriveId, getExportDir, getExportDirectoryName, getKey, getNextNonce, getRealRoot, getSequencer, getShareDirectoryName, getVirtualDriveDirectoryName, getVirtualFile, hasConfig, initFS, initialize, openDrive, openDrive, revokeAuthorization, setAuthConfigFilename, setConfigFilename, setDefaultFileChunkSize, setExportDirectoryName, setPassword, setSequencer, setShareDirectoryName, setVirtualDriveDirectoryName
-
-
-
-
Method Detail
-
open
public static AesDrive open(IFile dir, java.lang.String password, INonceSequencer sequencer) throws java.io.IOException
Helper method that opens and initializes a Drive- Parameters:
dir
- The directory that hosts the drive.password
- The password.sequencer
- The nonce sequencer that will be used for encryption.- Returns:
- The drive.
- Throws:
java.io.IOException
- Thrown if error occurs during opening the drive.
-
create
public static AesDrive create(IFile dir, java.lang.String password, INonceSequencer sequencer) throws java.io.IOException
Helper method that creates and initializes a Drive- Parameters:
dir
- The directory that will host the drive.password
- The password.sequencer
- The nonce sequencer that will be used for encryption.- Returns:
- The drive.
- Throws:
java.io.IOException
- If error occurs during creating the drive.
-
getPrivateDir
public IFile getPrivateDir() throws java.lang.Exception
Get a private dir for sharing files with external applications.- Specified by:
getPrivateDir
in classVirtualDrive
- Returns:
- The private directory
- Throws:
java.lang.Exception
- Thrown if error occurs
-
onUnlockSuccess
public void onUnlockSuccess()
Called when drive unlock succeeds.- Specified by:
onUnlockSuccess
in classVirtualDrive
-
onUnlockError
public void onUnlockError()
Called when drive unlock fails.- Specified by:
onUnlockError
in classVirtualDrive
-
-