Package com.mku.android.salmonfs.drive
Class AndroidDrive
java.lang.Object
com.mku.fs.drive.VirtualDrive
com.mku.salmonfs.drive.AesDrive
com.mku.android.salmonfs.drive.AndroidDrive
Implementation of a virtual drive for android.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProtected constructor, use open() and create() instead. -
Method Summary
Modifier and TypeMethodDescriptioncopyToSharedFolder(AesFile aesFile) Copy file to shared folderstatic AesDrivecreate(IFile dir, String password, INonceSequencer sequencer) Helper method that creates and initializes a AndroidDriveGet the private directory that will be used for sharing encrypted context with other apps on the android device.voidFired when unlock fails.voidFired when unlock succeeds.static AesDriveopen(IFile dir, String password, INonceSequencer sequencer) Helper method that opens and initializes an AndroidDriveMethods 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, getRoot, getSequencer, getShareDirectoryName, getVirtualDriveDirectoryName, getVirtualFile, hasConfig, initFS, initialize, openDrive, openDrive, revokeAuthorization, setAuthConfigFilename, setConfigFilename, setDefaultFileChunkSize, setExportDirectoryName, setPassword, setSequencer, setShareDirectoryName, setVirtualDriveDirectoryName
-
Constructor Details
-
AndroidDrive
protected AndroidDrive()Protected constructor, use open() and create() instead.
-
-
Method Details
-
open
public static AesDrive open(IFile dir, String password, INonceSequencer sequencer) throws IOException Helper method that opens and initializes an AndroidDrive- Parameters:
dir- The URL that hosts the drive. This can be either a raw URL or a REST API URL, see Salmon Web Service for usage.password- The password.sequencer- The nonce sequencer that will be used for encryption.- Returns:
- The drive.
- Throws:
IOException- Thrown if error occurs during opening the drive.
-
create
public static AesDrive create(IFile dir, String password, INonceSequencer sequencer) throws IOException Helper method that creates and initializes a AndroidDrive- 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:
IOException- If error occurs during creating the drive.
-
getPrivateDir
Get the private directory that will be used for sharing encrypted context with other apps on the android device.- Specified by:
getPrivateDirin classVirtualDrive- Returns:
- The private directory
-
onUnlockSuccess
public void onUnlockSuccess()Fired when unlock succeeds.- Specified by:
onUnlockSuccessin classVirtualDrive
-
onUnlockError
public void onUnlockError()Fired when unlock fails.- Specified by:
onUnlockErrorin classVirtualDrive
-