Class AndroidDrive

java.lang.Object
com.mku.file.VirtualDrive
com.mku.salmon.SalmonDrive
com.mku.android.salmon.drive.AndroidDrive

public class AndroidDrive extends SalmonDrive
Implementation of a virtual drive for android.
  • 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
    • copyToSharedFolder

      public File copyToSharedFolder(SalmonFile salmonFile) throws Exception
      Copy file to shared folder
      Parameters:
      salmonFile - The file
      Returns:
      The shared file
      Throws:
      Exception - Thrown when error occured
    • getPrivateDir

      public IRealFile getPrivateDir()
      Get the private directory that will be used for sharing encrypted context with other apps on the android device.
      Specified by:
      getPrivateDir in class VirtualDrive
      Returns:
      The private directory
    • getRealFile

      public IRealFile getRealFile(String uri, boolean isDirectory)
      Get the real file hosted on the android device.
      Parameters:
      uri - The real file uri
      isDirectory - True if filepath corresponds to a directory.
      Returns:
      The real file
    • onUnlockSuccess

      public void onUnlockSuccess()
      Fired when unlock succeeds.
      Specified by:
      onUnlockSuccess in class VirtualDrive
    • onUnlockError

      public void onUnlockError()
      Fired when unlock fails.
      Specified by:
      onUnlockError in class VirtualDrive