public static final class DocumentsContract.Document extends Object
Cursor
column names
and flags.
A document can be either an openable stream (with a specific MIME type),
or a directory containing additional documents (with the
MIME_TYPE_DIR
MIME type). A directory represents the top of a
subtree containing zero or more documents, which can recursively contain
even more documents and directories.
All columns are read-only to client applications.
Modifier and Type | Field and Description |
---|---|
static String |
COLUMN_DISPLAY_NAME
Display name of a document, used as the primary title displayed to a
user.
|
static String |
COLUMN_DOCUMENT_ID
Unique ID of a document.
|
static String |
COLUMN_FLAGS
Flags that apply to a document.
|
static String |
COLUMN_ICON
Specific icon resource ID for a document.
|
static String |
COLUMN_LAST_MODIFIED
Timestamp when a document was last modified, in milliseconds since
January 1, 1970 00:00:00.0 UTC.
|
static String |
COLUMN_MIME_TYPE
Concrete MIME type of a document.
|
static String |
COLUMN_SIZE
Size of a document, in bytes, or
null if unknown. |
static String |
COLUMN_SUMMARY
Summary of a document, which may be shown to a user.
|
static int |
FLAG_ARCHIVE
Flag indicating that a document is an archive, and it's contents can be
obtained via
DocumentsProvider.queryChildDocuments(java.lang.String, java.lang.String[], java.lang.String) . |
static int |
FLAG_DIR_PREFERS_GRID
Flag indicating that a directory prefers its contents be shown in a
larger format grid.
|
static int |
FLAG_DIR_PREFERS_LAST_MODIFIED
Flag indicating that a directory prefers its contents be sorted by
COLUMN_LAST_MODIFIED . |
static int |
FLAG_DIR_SUPPORTS_CREATE
Flag indicating that a document is a directory that supports creation
of new files within it.
|
static int |
FLAG_PARTIAL
Flag indicating that a document is not complete, likely its
contents are being downloaded.
|
static int |
FLAG_SUPPORTS_COPY
Flag indicating that a document can be copied to another location
within the same document provider.
|
static int |
FLAG_SUPPORTS_DELETE
Flag indicating that a document is deletable.
|
static int |
FLAG_SUPPORTS_MOVE
Flag indicating that a document can be moved to another location
within the same document provider.
|
static int |
FLAG_SUPPORTS_REMOVE
Flag indicating that a document can be removed from a parent.
|
static int |
FLAG_SUPPORTS_RENAME
Flag indicating that a document can be renamed.
|
static int |
FLAG_SUPPORTS_THUMBNAIL
Flag indicating that a document can be represented as a thumbnail.
|
static int |
FLAG_SUPPORTS_WRITE
Flag indicating that a document supports writing.
|
static int |
FLAG_VIRTUAL_DOCUMENT
Flag indicating that a document is virtual, and doesn't have byte
representation in the MIME type specified as
COLUMN_MIME_TYPE . |
static String |
MIME_TYPE_DIR
MIME type of a document which is a directory that may contain
additional documents.
|
public static final String COLUMN_DOCUMENT_ID
DocumentsProvider
, and should be treated as an opaque
value by client applications. This column is required.
Each document must have a unique ID within a provider, but that single document may be included as a child of multiple directories.
A provider must always return durable IDs, since they will be used to
issue long-term URI permission grants when an application interacts
with Intent.ACTION_OPEN_DOCUMENT
and
Intent.ACTION_CREATE_DOCUMENT
.
Type: STRING
public static final String COLUMN_MIME_TYPE
MIME_TYPE_DIR
MIME type. This column is required.
Type: STRING
MIME_TYPE_DIR
,
Constant Field Valuespublic static final String COLUMN_DISPLAY_NAME
Type: STRING
public static final String COLUMN_SUMMARY
null
.
Type: STRING
public static final String COLUMN_LAST_MODIFIED
null
if unknown. A DocumentsProvider
can update this
field using events from ParcelFileDescriptor.OnCloseListener
or other reliable
ParcelFileDescriptor
transports.
Type: INTEGER (long)
System.currentTimeMillis()
,
Constant Field Valuespublic static final String COLUMN_ICON
null
to use a platform-provided default icon based
on COLUMN_MIME_TYPE
.
Type: INTEGER (int)
public static final String COLUMN_FLAGS
Type: INTEGER (int)
public static final String COLUMN_SIZE
null
if unknown. This column
is required.
Type: INTEGER (long)
public static final String MIME_TYPE_DIR
COLUMN_MIME_TYPE
,
Constant Field Valuespublic static final int FLAG_SUPPORTS_THUMBNAIL
public static final int FLAG_SUPPORTS_WRITE
When a document is opened with Intent.ACTION_OPEN_DOCUMENT
,
the calling application is granted both
Intent.FLAG_GRANT_READ_URI_PERMISSION
and
Intent.FLAG_GRANT_WRITE_URI_PERMISSION
. However, the actual
writability of a document may change over time, for example due to
remote access changes. This flag indicates that a document client can
expect ContentResolver.openOutputStream(Uri)
to succeed.
COLUMN_FLAGS
,
Constant Field Valuespublic static final int FLAG_SUPPORTS_DELETE
public static final int FLAG_DIR_SUPPORTS_CREATE
COLUMN_MIME_TYPE
is
MIME_TYPE_DIR
.public static final int FLAG_DIR_PREFERS_GRID
COLUMN_MIME_TYPE
is
MIME_TYPE_DIR
.COLUMN_FLAGS
,
Constant Field Valuespublic static final int FLAG_DIR_PREFERS_LAST_MODIFIED
COLUMN_LAST_MODIFIED
. Only valid when
COLUMN_MIME_TYPE
is MIME_TYPE_DIR
.COLUMN_FLAGS
,
Constant Field Valuespublic static final int FLAG_SUPPORTS_RENAME
public static final int FLAG_SUPPORTS_COPY
public static final int FLAG_SUPPORTS_MOVE
public static final int FLAG_VIRTUAL_DOCUMENT
COLUMN_MIME_TYPE
.public static final int FLAG_SUPPORTS_REMOVE
public static final int FLAG_ARCHIVE
DocumentsProvider.queryChildDocuments(java.lang.String, java.lang.String[], java.lang.String)
.
The provider support library offers utility classes to add common archive support.
public static final int FLAG_PARTIAL
COLUMN_FLAGS
,
Constant Field Values