Package com.mku.android.salmonfs.drive
Class AndroidDrive
- java.lang.Object
-
- com.mku.fs.drive.VirtualDrive
-
- com.mku.salmonfs.drive.AesDrive
-
- com.mku.salmonfs.drive.Drive
-
- com.mku.android.salmonfs.drive.AndroidDrive
-
public class AndroidDrive extends Drive
Implementation of a virtual drive for android.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AndroidDrive()
Protected constructor, use open() and create() instead.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.File
copyToSharedFolder(AesFile aesFile)
Copy file to shared folderstatic Context
getContext()
Get the Android context.IFile
getPrivateDir()
Get the private directory that will be used for sharing encrypted context with other apps on the android device.IFile
getRealFile(java.lang.String uri, boolean isDirectory)
Get the real file hosted on the android device.static void
initialize(Context context)
Initialize the Android Drive before creating or opening any virtual drives.void
onUnlockError()
Fired when unlock fails.void
onUnlockSuccess()
Fired when unlock succeeds.-
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
-
initialize
public static void initialize(Context context)
Initialize the Android Drive before creating or opening any virtual drives.- Parameters:
context
- The context
-
getContext
public static Context getContext()
Get the Android context.- Returns:
- The Android context
-
copyToSharedFolder
public java.io.File copyToSharedFolder(AesFile aesFile) throws java.lang.Exception
Copy file to shared folder- Parameters:
aesFile
- The file- Returns:
- The shared file
- Throws:
java.lang.Exception
- Thrown when error occured
-
getPrivateDir
public IFile getPrivateDir()
Get the private directory that will be used for sharing encrypted context with other apps on the android device.- Overrides:
getPrivateDir
in classDrive
- Returns:
- The private directory
-
getRealFile
public IFile getRealFile(java.lang.String uri, boolean isDirectory)
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.- Overrides:
onUnlockSuccess
in classDrive
-
onUnlockError
public void onUnlockError()
Fired when unlock fails.- Overrides:
onUnlockError
in classDrive
-
-