Drive API v2 (revision 47)



com.google.api.services.drive.model
Class File

java.lang.Object
  extended by java.util.AbstractMap<java.lang.String,java.lang.Object>
      extended by com.google.api.client.util.GenericData
          extended by com.google.api.client.json.GenericJson
              extended by com.google.api.services.drive.model.File
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Object>

public final class File
extends GenericJson

The metadata for a file.

This is the Java data model class that specifies how to parse/serialize into the JSON that is transmitted over HTTP when working with the Drive API. For a detailed explanation see: http://code.google.com/p/google-api-java-client/wiki/Json

Upgrade warning: starting with version 1.12 getResponseHeaders() is removed, instead use JsonHttpRequest.getLastResponseHeaders()

Author:
Google, Inc.

Nested Class Summary
static class File.ImageMediaMetadata
          Metadata about image media.
static class File.IndexableText
          Indexable text attributes for the file (can only be written)
static class File.Labels
          A group of labels for the file.
static class File.Thumbnail
          Thumbnail for the file.
 
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
GenericData.Flags
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
File()
           
 
Method Summary
 java.lang.String getAlternateLink()
          A link for opening the file in using a relevant Google editor or viewer.
 DateTime getCreatedDate()
          Create time for this file (formatted ISO8601 timestamp).
 java.lang.String getDescription()
          A short description of the file.
 java.lang.String getDownloadUrl()
          Short term download URL for the file.
 java.lang.Boolean getEditable()
          Whether the file can be edited by the current user.
 java.lang.String getEmbedLink()
          A link for embedding the file.
 java.lang.String getEtag()
          ETag of the file.
 java.lang.Boolean getExplicitlyTrashed()
          Whether this file has been explicitly trashed, as opposed to recursively trashed.
 java.util.Map<java.lang.String,java.lang.String> getExportLinks()
          Links for exporting Google Docs to specific formats.
 java.lang.String getFileExtension()
          The file extension used when downloading this file.
 java.lang.Long getFileSize()
          The size of the file in bytes.
 java.lang.String getIconLink()
          A link to the file's icon.
 java.lang.String getId()
          The id of the file.
 File.ImageMediaMetadata getImageMediaMetadata()
          Metadata about image media.
 File.IndexableText getIndexableText()
          Indexable text attributes for the file (can only be written) The value returned may be null.
 java.lang.String getKind()
          The type of file.
 File.Labels getLabels()
          A group of labels for the file.
 java.lang.String getLastModifyingUserName()
          Name of the last user to modify this file.
 DateTime getLastViewedByMeDate()
          Last time this file was viewed by the user (formatted RFC 3339 timestamp).
 java.lang.String getMd5Checksum()
          An MD5 checksum for the content of this file.
 java.lang.String getMimeType()
          The MIME type of the file.
 DateTime getModifiedByMeDate()
          Last time this file was modified by the user (formatted RFC 3339 timestamp).
 DateTime getModifiedDate()
          Last time this file was modified by anyone (formatted RFC 3339 timestamp).
 java.lang.String getOriginalFilename()
          The original filename if the file was uploaded manually, or the original title if the file was inserted through the API.
 java.util.List<java.lang.String> getOwnerNames()
          Name(s) of the owner(s) of this file.
 java.util.List<ParentReference> getParents()
          Collection of parent folders which contain this file.
 java.lang.Long getQuotaBytesUsed()
          The number of quota bytes used by this file.
 java.lang.String getSelfLink()
          A link back to this file.
 java.lang.Boolean getShared()
          Whether the file has been shared.
 DateTime getSharedWithMeDate()
          Time at which this file was shared with the user (formatted RFC 3339 timestamp).
 File.Thumbnail getThumbnail()
          Thumbnail for the file.
 java.lang.String getThumbnailLink()
          A link to the file's thumbnail.
 java.lang.String getTitle()
          The title of this file.
 Permission getUserPermission()
          The permissions for the authenticated user on this file.
 java.lang.String getWebContentLink()
          A link for downloading the content of the file in a browser using cookie based authentication.
 java.lang.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.
 java.lang.Boolean getWritersCanShare()
          Whether writers can share the document with other users.
 File setAlternateLink(java.lang.String alternateLink)
          A link for opening the file in using a relevant Google editor or viewer.
 File setCreatedDate(DateTime createdDate)
          Create time for this file (formatted ISO8601 timestamp).
 File setDescription(java.lang.String description)
          A short description of the file.
 File setDownloadUrl(java.lang.String downloadUrl)
          Short term download URL for the file.
 File setEditable(java.lang.Boolean editable)
          Whether the file can be edited by the current user.
 File setEmbedLink(java.lang.String embedLink)
          A link for embedding the file.
 File setEtag(java.lang.String etag)
          ETag of the file.
 File setExplicitlyTrashed(java.lang.Boolean explicitlyTrashed)
          Whether this file has been explicitly trashed, as opposed to recursively trashed.
 File setExportLinks(java.util.Map<java.lang.String,java.lang.String> exportLinks)
          Links for exporting Google Docs to specific formats.
 File setFileExtension(java.lang.String fileExtension)
          The file extension used when downloading this file.
 File setFileSize(java.lang.Long fileSize)
          The size of the file in bytes.
 File setIconLink(java.lang.String iconLink)
          A link to the file's icon.
 File setId(java.lang.String id)
          The id of the file.
 File setImageMediaMetadata(File.ImageMediaMetadata imageMediaMetadata)
          Metadata about image media.
 File setIndexableText(File.IndexableText indexableText)
          Indexable text attributes for the file (can only be written) The value set may be null.
 File setKind(java.lang.String kind)
          The type of file.
 File setLabels(File.Labels labels)
          A group of labels for the file.
 File setLastModifyingUserName(java.lang.String lastModifyingUserName)
          Name of the last user to modify this file.
 File setLastViewedByMeDate(DateTime lastViewedByMeDate)
          Last time this file was viewed by the user (formatted RFC 3339 timestamp).
 File setMd5Checksum(java.lang.String md5Checksum)
          An MD5 checksum for the content of this file.
 File setMimeType(java.lang.String mimeType)
          The MIME type of the file.
 File setModifiedByMeDate(DateTime modifiedByMeDate)
          Last time this file was modified by the user (formatted RFC 3339 timestamp).
 File setModifiedDate(DateTime modifiedDate)
          Last time this file was modified by anyone (formatted RFC 3339 timestamp).
 File setOriginalFilename(java.lang.String originalFilename)
          The original filename if the file was uploaded manually, or the original title if the file was inserted through the API.
 File setOwnerNames(java.util.List<java.lang.String> ownerNames)
          Name(s) of the owner(s) of this file.
 File setParents(java.util.List<ParentReference> parents)
          Collection of parent folders which contain this file.
 File setQuotaBytesUsed(java.lang.Long quotaBytesUsed)
          The number of quota bytes used by this file.
 File setSelfLink(java.lang.String selfLink)
          A link back to this file.
 File setShared(java.lang.Boolean shared)
          Whether the file has been shared.
 File setSharedWithMeDate(DateTime sharedWithMeDate)
          Time at which this file was shared with the user (formatted RFC 3339 timestamp).
 File setThumbnail(File.Thumbnail thumbnail)
          Thumbnail for the file.
 File setThumbnailLink(java.lang.String thumbnailLink)
          A link to the file's thumbnail.
 File setTitle(java.lang.String title)
          The title of this file.
 File setUserPermission(Permission userPermission)
          The permissions for the authenticated user on this file.
 File setWebContentLink(java.lang.String webContentLink)
          A link for downloading the content of the file in a browser using cookie based authentication.
 File setWebViewLink(java.lang.String webViewLink)
          A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
 File setWritersCanShare(java.lang.Boolean writersCanShare)
          Whether writers can share the document with other users.
 
Methods inherited from class com.google.api.client.json.GenericJson
clone, getFactory, setFactory, toPrettyString, toString
 
Methods inherited from class com.google.api.client.util.GenericData
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, set, setUnknownKeys
 
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

File

public File()
Method Detail

getAlternateLink

public java.lang.String getAlternateLink()
A link for opening the file in using a relevant Google editor or viewer. The value returned may be null.


setAlternateLink

public File setAlternateLink(java.lang.String alternateLink)
A link for opening the file in using a relevant Google editor or viewer. The value set may be null.


getCreatedDate

public DateTime getCreatedDate()
Create time for this file (formatted ISO8601 timestamp). The value returned may be null.


setCreatedDate

public File setCreatedDate(DateTime createdDate)
Create time for this file (formatted ISO8601 timestamp). The value set may be null.


getDescription

public java.lang.String getDescription()
A short description of the file. The value returned may be null.


setDescription

public File setDescription(java.lang.String description)
A short description of the file. The value set may be null.


getDownloadUrl

public java.lang.String getDownloadUrl()
Short term download URL for the file. This will only be populated on files with content stored in Drive. The value returned may be null.


setDownloadUrl

public File setDownloadUrl(java.lang.String downloadUrl)
Short term download URL for the file. This will only be populated on files with content stored in Drive. The value set may be null.


getEditable

public java.lang.Boolean getEditable()
Whether the file can be edited by the current user. The value returned may be null.


setEditable

public File setEditable(java.lang.Boolean editable)
Whether the file can be edited by the current user. The value set may be null.


getEmbedLink

public java.lang.String getEmbedLink()
A link for embedding the file. The value returned may be null.


setEmbedLink

public File setEmbedLink(java.lang.String embedLink)
A link for embedding the file. The value set may be null.


getEtag

public java.lang.String getEtag()
ETag of the file. The value returned may be null.


setEtag

public File setEtag(java.lang.String etag)
ETag of the file. The value set may be null.


getExplicitlyTrashed

public java.lang.Boolean getExplicitlyTrashed()
Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed. The value returned may be null.


setExplicitlyTrashed

public File setExplicitlyTrashed(java.lang.Boolean explicitlyTrashed)
Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed. The value set may be null.


getExportLinks

public java.util.Map<java.lang.String,java.lang.String> getExportLinks()
Links for exporting Google Docs to specific formats. The value returned may be null.


setExportLinks

public File setExportLinks(java.util.Map<java.lang.String,java.lang.String> exportLinks)
Links for exporting Google Docs to specific formats. The value set may be null.


getFileExtension

public java.lang.String getFileExtension()
The file extension used when downloading this file. This field is set from the title when inserting or uploading new content. This will only be populated on files with content stored in Drive. The value returned may be null.


setFileExtension

public File setFileExtension(java.lang.String fileExtension)
The file extension used when downloading this file. This field is set from the title when inserting or uploading new content. This will only be populated on files with content stored in Drive. The value set may be null.


getFileSize

public java.lang.Long getFileSize()
The size of the file in bytes. This will only be populated on files with content stored in Drive. The value returned may be null.


setFileSize

public File setFileSize(java.lang.Long fileSize)
The size of the file in bytes. This will only be populated on files with content stored in Drive. The value set may be null.


getIconLink

public java.lang.String getIconLink()
A link to the file's icon. The value returned may be null.


setIconLink

public File setIconLink(java.lang.String iconLink)
A link to the file's icon. The value set may be null.


getId

public java.lang.String getId()
The id of the file. The value returned may be null.


setId

public File setId(java.lang.String id)
The id of the file. The value set may be null.


getImageMediaMetadata

public File.ImageMediaMetadata getImageMediaMetadata()
Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content. The value returned may be null.


setImageMediaMetadata

public File setImageMediaMetadata(File.ImageMediaMetadata imageMediaMetadata)
Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content. The value set may be null.


getIndexableText

public File.IndexableText getIndexableText()
Indexable text attributes for the file (can only be written) The value returned may be null.


setIndexableText

public File setIndexableText(File.IndexableText indexableText)
Indexable text attributes for the file (can only be written) The value set may be null.


getKind

public java.lang.String getKind()
The type of file. This is always drive#file. The value returned may be null.


setKind

public File setKind(java.lang.String kind)
The type of file. This is always drive#file. The value set may be null.


getLabels

public File.Labels getLabels()
A group of labels for the file. The value returned may be null.


setLabels

public File setLabels(File.Labels labels)
A group of labels for the file. The value set may be null.


getLastModifyingUserName

public java.lang.String getLastModifyingUserName()
Name of the last user to modify this file. This will only be populated if a user has edited this file. The value returned may be null.


setLastModifyingUserName

public File setLastModifyingUserName(java.lang.String lastModifyingUserName)
Name of the last user to modify this file. This will only be populated if a user has edited this file. The value set may be null.


getLastViewedByMeDate

public DateTime getLastViewedByMeDate()
Last time this file was viewed by the user (formatted RFC 3339 timestamp). The value returned may be null.


setLastViewedByMeDate

public File setLastViewedByMeDate(DateTime lastViewedByMeDate)
Last time this file was viewed by the user (formatted RFC 3339 timestamp). The value set may be null.


getMd5Checksum

public java.lang.String getMd5Checksum()
An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive. The value returned may be null.


setMd5Checksum

public File setMd5Checksum(java.lang.String md5Checksum)
An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive. The value set may be null.


getMimeType

public java.lang.String getMimeType()
The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type. The value returned may be null.


setMimeType

public File setMimeType(java.lang.String mimeType)
The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type. The value set may be null.


getModifiedByMeDate

public DateTime getModifiedByMeDate()
Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. The value returned may be null.


setModifiedByMeDate

public File setModifiedByMeDate(DateTime modifiedByMeDate)
Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. The value set may be null.


getModifiedDate

public DateTime getModifiedDate()
Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set. The value returned may be null.


setModifiedDate

public File setModifiedDate(DateTime modifiedDate)
Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set. The value set may be null.


getOriginalFilename

public java.lang.String getOriginalFilename()
The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive. The value returned may be null.


setOriginalFilename

public File setOriginalFilename(java.lang.String originalFilename)
The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive. The value set may be null.


getOwnerNames

public java.util.List<java.lang.String> getOwnerNames()
Name(s) of the owner(s) of this file. The value returned may be null.


setOwnerNames

public File setOwnerNames(java.util.List<java.lang.String> ownerNames)
Name(s) of the owner(s) of this file. The value set may be null.


getParents

public java.util.List<ParentReference> getParents()
Collection of parent folders which contain this file. Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder. The value returned may be null.


setParents

public File setParents(java.util.List<ParentReference> parents)
Collection of parent folders which contain this file. Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder. The value set may be null.


getQuotaBytesUsed

public java.lang.Long getQuotaBytesUsed()
The number of quota bytes used by this file. The value returned may be null.


setQuotaBytesUsed

public File setQuotaBytesUsed(java.lang.Long quotaBytesUsed)
The number of quota bytes used by this file. The value set may be null.


getSelfLink

public java.lang.String getSelfLink()
A link back to this file. The value returned may be null.


setSelfLink

public File setSelfLink(java.lang.String selfLink)
A link back to this file. The value set may be null.


getShared

public java.lang.Boolean getShared()
Whether the file has been shared. The value returned may be null.


setShared

public File setShared(java.lang.Boolean shared)
Whether the file has been shared. The value set may be null.


getSharedWithMeDate

public DateTime getSharedWithMeDate()
Time at which this file was shared with the user (formatted RFC 3339 timestamp). The value returned may be null.


setSharedWithMeDate

public File setSharedWithMeDate(DateTime sharedWithMeDate)
Time at which this file was shared with the user (formatted RFC 3339 timestamp). The value set may be null.


getThumbnail

public File.Thumbnail getThumbnail()
Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google. The value returned may be null.


setThumbnail

public File setThumbnail(File.Thumbnail thumbnail)
Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google. The value set may be null.


getThumbnailLink

public java.lang.String getThumbnailLink()
A link to the file's thumbnail. The value returned may be null.


setThumbnailLink

public File setThumbnailLink(java.lang.String thumbnailLink)
A link to the file's thumbnail. The value set may be null.


getTitle

public java.lang.String getTitle()
The title of this file. The value returned may be null.


setTitle

public File setTitle(java.lang.String title)
The title of this file. The value set may be null.


getUserPermission

public Permission getUserPermission()
The permissions for the authenticated user on this file. The value returned may be null.


setUserPermission

public File setUserPermission(Permission userPermission)
The permissions for the authenticated user on this file. The value set may be null.


getWebContentLink

public java.lang.String getWebContentLink()
A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. The value returned may be null.


setWebContentLink

public File setWebContentLink(java.lang.String webContentLink)
A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. The value set may be null.


getWebViewLink

public java.lang.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. The value returned may be null.


setWebViewLink

public File setWebViewLink(java.lang.String webViewLink)
A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting. The value set may be null.


getWritersCanShare

public java.lang.Boolean getWritersCanShare()
Whether writers can share the document with other users. The value returned may be null.


setWritersCanShare

public File setWritersCanShare(java.lang.Boolean writersCanShare)
Whether writers can share the document with other users. The value set may be null.