ExternalStorageProvider

Class of snx.android.provider · ExternalStorageProvider.java

public final class ExternalStorageProvider extends DocumentsProvider

ExternalStorageProvider ← DocumentsProvider ← ContentProvider

The device's shared storage as the system's documents provider shows it (com.android.externalstorage.documents, the one DocumentsUI's pickers answer with): the files under Environment.getExternalStorageDirectory(), a document's ID "primary:" and its path there, as Android's, so that an app that turns an ID into a path (the primary volume's folder, then the path) finds the same file. A folder the picker gives that is elsewhere on the host is linked into the shared storage (shared), as if the user had picked it there.

Fields

public static final String AUTHORITY = "com.android.externalstorage.documents" source

Methods

public static String documentId(File file) source

the document ID of a file in the shared storage, null for one elsewhere

public static File shared(File file) source

A host file as a file of the shared storage: itself when it is in it, else a link to it in the storage's top folder, by its name (another name when that one is taken by something else)

public boolean onCreate() source
public Cursor queryRoots(String[] projection) source
public Cursor queryDocument(String documentId, String[] projection) throws FileNotFoundException source
public Cursor queryChildDocuments(String parentDocumentId, String[] projection, String sortOrder) throws FileNotFoundException source
public boolean isChildDocument(String parentDocumentId, String documentId) source
public ParcelFileDescriptor openDocument(String documentId, String mode, CancellationSignal signal) throws FileNotFoundException source
public String createDocument(String parentDocumentId, String mimeType, String displayName) throws FileNotFoundException source
public void deleteDocument(String documentId) throws FileNotFoundException source

a file, or a folder with what it holds

public String copyDocument(String sourceDocumentId, String targetParentDocumentId) throws FileNotFoundException source
public String moveDocument(String sourceDocumentId, String sourceParentDocumentId, String targetParentDocumentId) throws FileNotFoundException source
public void removeDocument(String documentId, String parentDocumentId) throws FileNotFoundException source
public String renameDocument(String documentId, String displayName) throws FileNotFoundException source

Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.