Class AndroidDrive


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

      public File copyToSharedFolder(AesFile aesFile) throws Exception
      Copy file to shared folder
      Parameters:
      aesFile - The file
      Returns:
      The shared file
      Throws:
      Exception - Thrown when error occurred
    • getPrivateDir

      public IFile 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
    • 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