Class AndroidDrive


  • public class AndroidDrive
    extends Drive
    Implementation of a virtual drive for android.
    • Constructor Detail

      • AndroidDrive

        protected AndroidDrive()
        Protected constructor, use open() and create() instead.
    • 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 class Drive
        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 uri
        isDirectory - True if filepath corresponds to a directory.
        Returns:
        The real file
      • onUnlockSuccess

        public void onUnlockSuccess()
        Fired when unlock succeeds.
        Overrides:
        onUnlockSuccess in class Drive
      • onUnlockError

        public void onUnlockError()
        Fired when unlock fails.
        Overrides:
        onUnlockError in class Drive