Metadata | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Constants | Ctors | Methods | Inherited Methods | [Expand All]
public abstract class

# Metadata

extends Object
implements Freezable<T>

java.lang.Object
↳ | com.google.android.gms.drive.Metadata

## Class Overview

The details of a Drive file or folder.

## Summary

Constants
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 Constructors
| Metadata()

Public Methods
String | getAlternateLink() Returns a link for opening the file using a relevant Google editor or viewer.
int | getContentAvailability() Returns `CONTENT_NOT_AVAILABLE_LOCALLY` when the content is not available on the device or `CONTENT_AVAILABLE_LOCALLY` when the content is available on the device.
Date | getCreatedDate() Returns the create time for this resource.
String | getDescription() A short description of the file.
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.
String | getMimeType() Returns the MIME type of the resource
Date | getModifiedByMeDate() Returns the last time this resource was modified by the user.
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.
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 | 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 file 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 | isTrashed() Returns true if this resource has been trashed.
boolean | isViewed() Whether this file has been viewed by this user.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
From interface com.google.android.gms.common.data.Freezable
abstract T | freeze() Freeze a volatile representation into an immutable representation.
abstract boolean | isDataValid() Check to see if this object is valid for use.

## Constants

#### public static final int CONTENT_AVAILABLE_LOCALLY

The content is available on the device.

Constant Value: 1 (0x00000001)

#### public static final int CONTENT_NOT_AVAILABLE_LOCALLY

The content is not available on the device.

Constant Value: 0 (0x00000000)

## Public Constructors

#### public Metadata ()

## Public Methods

#### public String getAlternateLink ()

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

#### public int getContentAvailability ()

Returns `CONTENT_NOT_AVAILABLE_LOCALLY` when the content is not available on the device or `CONTENT_AVAILABLE_LOCALLY` when the content is available on the device.

#### public Date getCreatedDate ()

Returns the create time for this resource.

#### public String getDescription ()

A short description of the file.

#### public DriveId getDriveId ()

Returns the id of the resource

#### public String getEmbedLink ()

A link for embedding the file.

#### public String getFileExtension ()

The file extension used when downloading this file.

#### public long getFileSize ()

The size of the file in bytes.

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

#### public Date getLastViewedByMeDate ()

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

#### public String getMimeType ()

Returns the MIME type of the resource

#### public Date getModifiedByMeDate ()

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

#### public Date getModifiedDate ()

Returns the last time this resource was modified by anyone.

#### public String getOriginalFilename ()

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

#### public long getQuotaBytesUsed ()

The number of quota bytes used by this file.

#### public Date getSharedWithMeDate ()

Returns the time at which this resource was shared with the user.

#### public String getTitle ()

Returns the title of the resource

#### public String getWebContentLink ()

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

#### public 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.

#### public boolean isEditable ()

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

#### public boolean isFolder ()

Returns true if this Metadata is for a folder.

#### public boolean isInAppFolder ()

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. @see https://developers.google.com/drive/appdata

#### public boolean isPinnable ()

Returns true if the file can be pinned. Not all shortcut app MIME types are pinnable.

#### public boolean isPinned ()

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

#### public boolean isRestricted ()

Whether viewers are prevented from downloading this file.

#### public boolean isShared ()

Returns true if this resource is a shared resource.

#### public boolean isStarred ()

Returns true if this resource is starred by the user.

#### public boolean isTrashed ()

Returns true if this resource has been trashed.

#### public boolean isViewed ()

Whether this file has been viewed by this user.