Metadata

public abstract classMetadataextendsObject
implementsFreezable<Metadata>

The details of a Drive file or folder.

Constant Summary

int CONTENT_AVAILABLE_LOCALLY The content is available on the device.
int CONTENT_NOT_AVAILABLE_LOCALLY The content is not available on the device.

Public Constructor Summary

Public Method Summary

String
getAlternateLink()
Returns a link for opening the file using a relevant Google editor or viewer.
int
getContentAvailability()
Returns CONTENT_NOT_AVAILABLE_LOCALLYwhen the content is not available on the device or CONTENT_AVAILABLE_LOCALLYwhen the content is available on the device.
Date
getCreatedDate()
Returns the create time for this resource.
Map<CustomPropertyKey,String>
getCustomProperties()
Gets all custom properties and their associated values.
String
getDescription()
A short description of the resource.
DriveId
getDriveId()
Returns the id of the resource
String
getEmbedLink()
A link for embedding the file.
String
getFileExtension()
The file extension used when downloading this file.
long
getFileSize()
The size of the file in bytes.
Date
getLastViewedByMeDate()
Returns the last time this resource was viewed by the user ornull if the user never viewed this resource.
String
getMimeType()
Returns the MIME type of the resource
Date
getModifiedByMeDate()
Returns the last time this resource was modified by the user or nullif the user never modified this resource.
Date
getModifiedDate()
Returns the last time this resource was modified by anyone.
String
getOriginalFilename()
The original filename if the file was uploaded manually, or the original title if the file was inserted through the API.
long
getQuotaBytesUsed()
The number of quota bytes used by this file.
Date
getSharedWithMeDate()
Returns the time at which this resource was shared with the user or nullif the user is the owner of this resource.
String
getTitle()
Returns the title of the resource
String
getWebContentLink()
A link for downloading the content of the file in a browser using cookie based authentication.
String
getWebViewLink()
A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
boolean
isEditable()
Returns true if this resource can be edited by the current user.
boolean
isExplicitlyTrashed()
Returns true if this resource has been explicitly trashed, as opposed to recursively trashed.
boolean
isFolder()
Returns true if this Metadata is for a folder.
boolean
isInAppFolder()
Returns true if this resource is in the Application Folder.
boolean
isPinnable()
Returns true if the resource can be pinned.
boolean
isPinned()
Returns true if this resource has been pinned (a request has been made to make the content available offline).
boolean
isRestricted()
Whether viewers are prevented from downloading this file.
boolean
isShared()
Returns true if this resource is a shared resource.
boolean
isStarred()
Returns true if this resource is starred by the user.
boolean
isTrashable()
Returns true if this resource can be trashed by this user.
boolean
isTrashed()
Returns true if this resource has been trashed.
boolean
isViewed()
Whether this file has been viewed by this user.

Inherited Method Summary

Constants

public static final int CONTENT_AVAILABLE_LOCALLY

The content is available on the device.

Constant Value:1

public static final int CONTENT_NOT_AVAILABLE_LOCALLY

The content is not available on the device.

Constant Value:0

Public Constructors

publicMetadata()

Public Methods

Returns a link for opening the file using a relevant Google editor or viewer.

public intgetContentAvailability()

Returns CONTENT_NOT_AVAILABLE_LOCALLYwhen the content is not available on the device or CONTENT_AVAILABLE_LOCALLYwhen the content is available on the device.

publicDategetCreatedDate()

Returns the create time for this resource.

publicMap<CustomPropertyKey,String> getCustomProperties()

Gets all custom properties and their associated values.

publicStringgetDescription()

A short description of the resource.

publicDriveId getDriveId()

Returns the id of the resource

A link for embedding the file.

publicStringgetFileExtension()

The file extension used when downloading this file.

public longgetFileSize()

The size of the file in bytes. Will return 0 for a folder.

This is only populated for files with content stored in Drive.

publicDategetLastViewedByMeDate()

Returns the last time this resource was viewed by the user ornullif the user never viewed this resource.

publicStringgetMimeType()

Returns the MIME type of the resource

publicDategetModifiedByMeDate()

Returns the last time this resource was modified by the user ornullif the user never modified this resource.

publicDategetModifiedDate()

Returns the last time this resource was modified by anyone.

publicStringgetOriginalFilename()

The original filename if the file was uploaded manually, or the original title if the file was inserted through the API.

public longgetQuotaBytesUsed()

The number of quota bytes used by this file. Will return 0 for a folder.

publicDategetSharedWithMeDate()

Returns the time at which this resource was shared with the user or nullif the user is the owner of this resource.

publicStringgetTitle()

Returns the title of the resource

A link for downloading the content of the file in a browser using cookie based authentication.

A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.

public booleanisEditable()

Returns true if this resource can be edited by the current user.

public booleanisExplicitlyTrashed()

Returns true if this resource has been explicitly trashed, as opposed to recursively trashed. This will return false if the file is not trashed.

public booleanisFolder()

Returns true if this Metadata is for a folder.

public booleanisInAppFolder()

Returns true if this resource is in the Application Folder.

The App Folder contains hidden files stored in a user's Drive that are only accessible to the creating app. More information at://developers.google /drive/appdata

public booleanisPinnable()

Returns true if the resource can be pinned. Folders and some shortcut app MIME types are pinnable.

public booleanisPinned()

Returns true if this resource has been pinned (a request has been made to make the content available offline).

public booleanisRestricted()

Whether viewers are prevented from downloading this file.

public booleanisShared()

Returns true if this resource is a shared resource.

public booleanisStarred()

Returns true if this resource is starred by the user.

public booleanisTrashable()

Returns true if this resource can be trashed by this user.

public booleanisTrashed()

Returns true if this resource has been trashed.

public booleanisViewed()

Whether this file has been viewed by this user.