Drive API v2 (revision 1)



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

java.lang.Object
  extended by java.util.AbstractMap<String,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:
Cloneable, Map<String,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

Author:
Google, Inc.

Nested Class Summary
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.
 
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
GenericData.Flags
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
File()
           
 
Method Summary
 String getAlternateLink()
          A link for opening the file in a browser.
 DateTime getCreatedDate()
          Create time for this file (formatted ISO8601 timestamp).
 String getDescription()
          A short description of the file.
 String getDownloadUrl()
          Short term download URL for the file.
 Boolean getEditable()
          Whether the file can be edited by the current user.
 String getEmbedLink()
          A link for embedding the file.
 String getEtag()
          ETag of the file.
 Map<String,String> getExportLinks()
          Links for exporting Google Docs to specific formats.
 String getFileExtension()
          The file extension used when downloading this file.
 Long getFileSize()
          The size of the file in bytes.
 String getId()
          The id of the file.
 File.IndexableText getIndexableText()
          Indexable text attributes for the file (can only be written) The value returned may be null.
 String getKind()
          The type of file.
 File.Labels getLabels()
          A group of labels for the file.
 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).
 String getMd5Checksum()
          An MD5 checksum for the content of this file.
 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).
 String getOriginalFilename()
          The filename when uploading this file.
 List<String> getOwnerNames()
          Name(s) of the owner(s) of this file.
 List<ParentReference> getParents()
          Collection of parent folders which contain this file.
 String getPermissionsLink()
          A link to the permissions collection.
 Long getQuotaBytesUsed()
          The number of quota bytes used by this file.
 HttpHeaders getResponseHeaders()
          Returns the HTTP headers that were returned with the server response, or null.
 String getSelfLink()
          A link back to this file.
 DateTime getSharedWithMeDate()
          Time at which this file was shared with the user (formatted RFC 3339 timestamp).
 String getThumbnailLink()
          A link to the file's thumbnail.
 String getTitle()
          The title of this file.
 Permission getUserPermission()
          The permissions for the authenticated user on this file.
 Boolean getWritersCanShare()
          Whether writers can share the document with other users.
 File setAlternateLink(String alternateLink)
          A link for opening the file in a browser.
 File setCreatedDate(DateTime createdDate)
          Create time for this file (formatted ISO8601 timestamp).
 File setDescription(String description)
          A short description of the file.
 File setDownloadUrl(String downloadUrl)
          Short term download URL for the file.
 File setEditable(Boolean editable)
          Whether the file can be edited by the current user.
 File setEmbedLink(String embedLink)
          A link for embedding the file.
 File setEtag(String etag)
          ETag of the file.
 File setExportLinks(Map<String,String> exportLinks)
          Links for exporting Google Docs to specific formats.
 File setFileExtension(String fileExtension)
          The file extension used when downloading this file.
 File setFileSize(Long fileSize)
          The size of the file in bytes.
 File setId(String id)
          The id of the file.
 File setIndexableText(File.IndexableText indexableText)
          Indexable text attributes for the file (can only be written) The value set may be null.
 File setKind(String kind)
          The type of file.
 File setLabels(File.Labels labels)
          A group of labels for the file.
 File setLastModifyingUserName(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(String md5Checksum)
          An MD5 checksum for the content of this file.
 File setMimeType(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(String originalFilename)
          The filename when uploading this file.
 File setOwnerNames(List<String> ownerNames)
          Name(s) of the owner(s) of this file.
 File setParents(List<ParentReference> parents)
          Collection of parent folders which contain this file.
 File setPermissionsLink(String permissionsLink)
          A link to the permissions collection.
 File setQuotaBytesUsed(Long quotaBytesUsed)
          The number of quota bytes used by this file.
 void setResponseHeaders(HttpHeaders responseHeaders)
          Sets the HTTP headers returned with the server response, or null.
 File setSelfLink(String selfLink)
          A link back to this file.
 File setSharedWithMeDate(DateTime sharedWithMeDate)
          Time at which this file was shared with the user (formatted RFC 3339 timestamp).
 File setThumbnailLink(String thumbnailLink)
          A link to the file's thumbnail.
 File setTitle(String title)
          The title of this file.
 File setUserPermission(Permission userPermission)
          The permissions for the authenticated user on this file.
 File setWritersCanShare(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

getMimeType

public String getMimeType()
The MIME type of the file. The value returned may be null.


setMimeType

public File setMimeType(String mimeType)
The MIME type of the file. The value set may be null.


getThumbnailLink

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


setThumbnailLink

public File setThumbnailLink(String thumbnailLink)
A link to the file's thumbnail. 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.


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.


getEtag

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


setEtag

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


getLastModifyingUserName

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


getWritersCanShare

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


setWritersCanShare

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


getId

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


setId

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


getTitle

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


setTitle

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


getOwnerNames

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


setOwnerNames

public File setOwnerNames(List<String> ownerNames)
Name(s) of the owner(s) of this file. 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.


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.


getParents

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


setParents

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


getExportLinks

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


setExportLinks

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


getOriginalFilename

public String getOriginalFilename()
The filename when uploading this file. This will only be populated on files with content stored in Drive. The value returned may be null.


setOriginalFilename

public File setOriginalFilename(String originalFilename)
The filename when uploading this file. This will only be populated on files with content stored in Drive. The value set may be null.


getDescription

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


setDescription

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


getEditable

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


setEditable

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


getKind

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


setKind

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


getQuotaBytesUsed

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


setQuotaBytesUsed

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


getFileSize

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


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.


getMd5Checksum

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


getEmbedLink

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


setEmbedLink

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


getAlternateLink

public String getAlternateLink()
A link for opening the file in a browser. The value returned may be null.


setAlternateLink

public File setAlternateLink(String alternateLink)
A link for opening the file in a browser. The value set may be null.


getPermissionsLink

public String getPermissionsLink()
A link to the permissions collection. The value returned may be null.


setPermissionsLink

public File setPermissionsLink(String permissionsLink)
A link to the permissions collection. The value set may be null.


getModifiedByMeDate

public DateTime getModifiedByMeDate()
Last time this file was modified by the user (formatted RFC 3339 timestamp). 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). The value set may be null.


getDownloadUrl

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


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.


getFileExtension

public String getFileExtension()
The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive. The value returned may be null.


setFileExtension

public File setFileExtension(String fileExtension)
The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive. The value set may be null.


getSelfLink

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


setSelfLink

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


getModifiedDate

public DateTime getModifiedDate()
Last time this file was modified by anyone (formatted RFC 3339 timestamp). The value returned may be null.


setModifiedDate

public File setModifiedDate(DateTime modifiedDate)
Last time this file was modified by anyone (formatted RFC 3339 timestamp). The value set may be null.


setResponseHeaders

public void setResponseHeaders(HttpHeaders responseHeaders)
Sets the HTTP headers returned with the server response, or null. This member should only be non-null if this object was the top level element of a response. For example, a request that returns a single File would include the response headers, while a request which returns an array of File, would have a non-null response header in the enclosing object only.


getResponseHeaders

public HttpHeaders getResponseHeaders()
Returns the HTTP headers that were returned with the server response, or null.