Package com.mku.android.salmon.drive
Class AndroidDrive
java.lang.Object
com.mku.file.VirtualDrive
com.mku.salmon.SalmonDrive
com.mku.android.salmon.drive.AndroidDrive
Implementation of a virtual drive for android.
-
Method Summary
Modifier and TypeMethodDescriptioncopyToSharedFolder
(SalmonFile salmonFile) Copy file to shared folderstatic Context
Get the Android context.Get the private directory that will be used for sharing encrypted context with other apps on the android device.getRealFile
(String uri, boolean isDirectory) Get the real file hosted on the android device.static void
initialize
(Context context) Initialize the Android Drive.void
Fired when unlock fails.void
Fired when unlock succeeds.Methods inherited from class com.mku.salmon.SalmonDrive
close, createDrive, getAuthConfigFilename, getAuthId, getBytesFromRealFile, getConfigFilename, getDefaultAuthConfigFilename, getDefaultFileChunkSize, getDriveConfig, getDriveId, getExportDir, getExportDirectoryName, getKey, getRealRoot, getRoot, getSequencer, getShareDirectoryName, getVirtualDriveDirectoryName, hasConfig, initFS, initialize, openDrive, revokeAuthorization, setAuthConfigFilename, setConfigFilename, setDefaultFileChunkSize, setExportDirectoryName, setPassword, setSequencer, setShareDirectoryName, setVirtualDriveDirectoryName
-
Method Details
-
initialize
public static void initialize(Context context) Initialize the Android Drive. This needs to run before you attempt to create or open any virtual drives.- Parameters:
context
- The context
-
getContext
public static Context getContext()Get the Android context.- Returns:
- The Android context
-
getPrivateDir
Get the private directory that will be used for sharing encrypted context with other apps on the android device.- Specified by:
getPrivateDir
in classVirtualDrive
- Returns:
- The private directory
-
getRealFile
Get the real file hosted on the android device.- Parameters:
uri
- The real file uriisDirectory
- True if filepath corresponds to a directory.- Returns:
- The real file
-
onUnlockSuccess
public void onUnlockSuccess()Fired when unlock succeeds.- Specified by:
onUnlockSuccess
in classVirtualDrive
-
onUnlockError
public void onUnlockError()Fired when unlock fails.- Specified by:
onUnlockError
in classVirtualDrive
-