DocumentsContractCompat

public final class DocumentsContractCompat
extends Object

java.lang.Object
   ↳ androidx.core.provider.DocumentsContractCompat


Helper for accessing features in DocumentsContract.

Summary

Nested classes

class DocumentsContractCompat.DocumentCompat

Helper for accessing features in DocumentsContract.Document

Public methods

static Uri buildChildDocumentsUri(String authority, String parentDocumentId)

Build URI representing the children of the target directory in a document provider.

static Uri buildChildDocumentsUriUsingTree(Uri treeUri, String parentDocumentId)

Build URI representing the children of the target directory in a document provider.

static Uri buildDocumentUri(String authority, String documentId)

Build URI representing the target DocumentsContract.Document.COLUMN_DOCUMENT_ID in a document provider.

static Uri buildDocumentUriUsingTree(Uri treeUri, String documentId)

Build URI representing the target DocumentsContract.Document.COLUMN_DOCUMENT_ID in a document provider.

static Uri buildTreeDocumentUri(String authority, String documentId)

Build URI representing access to descendant documents of the given DocumentsContract.Document.COLUMN_DOCUMENT_ID.

static Uri createDocument(ContentResolver content, Uri parentDocumentUri, String mimeType, String displayName)

Create a new document with given MIME type and display name.

static String getDocumentId(Uri documentUri)

Extract the DocumentsContract.Document.COLUMN_DOCUMENT_ID from the given URI.

static String getTreeDocumentId(Uri documentUri)

Extract the via DocumentsContract.Document.COLUMN_DOCUMENT_ID from the given URI.

static boolean isDocumentUri(Context context, Uri uri)

Checks if the given URI represents a DocumentsContract.Document backed by a DocumentsProvider.

static boolean isTreeUri(Uri uri)

Checks if the given URI represents a DocumentsContract.Document tree.

static boolean removeDocument(ContentResolver content, Uri documentUri, Uri parentDocumentUri)

Removes the given document from a parent directory.

static Uri renameDocument(ContentResolver content, Uri documentUri, String displayName)

Change the display name of an existing document.

Inherited methods

Public methods

buildChildDocumentsUri

public static Uri buildChildDocumentsUri (String authority, 
                String parentDocumentId)

Build URI representing the children of the target directory in a document provider. When queried, a provider will return zero or more rows with columns defined by DocumentsContract.Document.

Parameters
authority String

parentDocumentId String

Returns
Uri

buildChildDocumentsUriUsingTree

public static Uri buildChildDocumentsUriUsingTree (Uri treeUri, 
                String parentDocumentId)

Build URI representing the children of the target directory in a document provider. When queried, a provider will return zero or more rows with columns defined by DocumentsContract.Document.

Parameters
treeUri Uri

parentDocumentId String

Returns
Uri

buildDocumentUri

public static Uri buildDocumentUri (String authority, 
                String documentId)

Build URI representing the target DocumentsContract.Document.COLUMN_DOCUMENT_ID in a document provider. When queried, a provider will return a single row with columns defined by DocumentsContract.Document.

Parameters
authority String

documentId String

Returns
Uri

See also: