public interface

ExternalDirResult

com.neomades.io.file.ExternalDirResult

Class Overview

Result of a requestExternalDir(ExternalDirCallback) request. It contains the directory and some information around its status (availability, user authorization).

Summary

Public Methods
abstract File getExternalDir()
Returns the primary shared/external storage directory requested using requestExternalDir(ExternalDirCallback).
abstract boolean isAuthorizedByUser()
Returns true if the user has authorized access to the external storage.
abstract boolean isAvailable()
Returns true if the directory can be accessed in the filesystem.

Public Methods

public abstract File getExternalDir ()

Returns the primary shared/external storage directory requested using requestExternalDir(ExternalDirCallback).

Consider trying the directory availability with isAvailable() and isAuthorizedByUser() before calling getExternalDir() to be sure that the directory exists otherwise the result will be null.

Returns
  • the external root directory (SDCard or Internal Memory) or null (if not available or if not called on Android platform)

public abstract boolean isAuthorizedByUser ()

Returns true if the user has authorized access to the external storage.

Returns
  • true if the user has authorized access to the external storage.

public abstract boolean isAvailable ()

Returns true if the directory can be accessed in the filesystem. It is true only on Android.

Returns
  • true if the directory exists and is available