public final class File extends GenericJson
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-http-java-client/wiki/JSON
Modifier and Type | Class and Description |
---|---|
static class |
File.Capabilities
Capabilities the current user has on this file.
|
static class |
File.ContentHints
Additional information about the content of the file.
|
static class |
File.ImageMediaMetadata
Additional metadata about image media, if available.
|
static class |
File.VideoMediaMetadata
Additional metadata about video media.
|
GenericData.Flags
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
File() |
Modifier and Type | Method and Description |
---|---|
File |
clone() |
Map<String,String> |
getAppProperties()
A collection of arbitrary key-value pairs which are private to the requesting app.
|
File.Capabilities |
getCapabilities()
Capabilities the current user has on this file.
|
File.ContentHints |
getContentHints()
Additional information about the content of the file.
|
Boolean |
getCopyRequiresWriterPermission()
Whether the options to copy, print, or download this file, should be disabled for readers and
commenters.
|
DateTime |
getCreatedTime()
The time at which the file was created (RFC 3339 date-time).
|
String |
getDescription()
A short description of the file.
|
Boolean |
getExplicitlyTrashed()
Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent
folder.
|
String |
getFileExtension()
The final component of fullFileExtension.
|
String |
getFolderColorRgb()
The color for a folder as an RGB hex string.
|
String |
getFullFileExtension()
The full file extension extracted from the name field.
|
Boolean |
getHasAugmentedPermissions()
Whether any users are granted file access directly on this file.
|
Boolean |
getHasThumbnail()
Whether this file has a thumbnail.
|
String |
getHeadRevisionId()
The ID of the file's head revision.
|
String |
getIconLink()
A static, unauthenticated link to the file's icon.
|
String |
getId()
The ID of the file.
|
File.ImageMediaMetadata |
getImageMediaMetadata()
Additional metadata about image media, if available.
|
Boolean |
getIsAppAuthorized()
Whether the file was created or opened by the requesting app.
|
String |
getKind()
Identifies what kind of resource this is.
|
User |
getLastModifyingUser()
The last user to modify the file.
|
String |
getMd5Checksum()
The MD5 checksum for the content of the file.
|
String |
getMimeType()
The MIME type of the file.
|
Boolean |
getModifiedByMe()
Whether the file has been modified by this user.
|
DateTime |
getModifiedByMeTime()
The last time the file was modified by the user (RFC 3339 date-time).
|
DateTime |
getModifiedTime()
The last time the file was modified by anyone (RFC 3339 date-time).
|
String |
getName()
The name of the file.
|
String |
getOriginalFilename()
The original filename of the uploaded content if available, or else the original value of the
name field.
|
Boolean |
getOwnedByMe()
Whether the user owns the file.
|
List<User> |
getOwners()
The owners of the file.
|
List<String> |
getParents()
The IDs of the parent folders which contain the file.
|
List<String> |
getPermissionIds()
List of permission IDs for users with access to this file.
|
List<Permission> |
getPermissions()
The full list of permissions for the file.
|
Map<String,String> |
getProperties()
A collection of arbitrary key-value pairs which are visible to all apps.
|
Long |
getQuotaBytesUsed()
The number of storage quota bytes used by the file.
|
Boolean |
getShared()
Whether the file has been shared.
|
DateTime |
getSharedWithMeTime()
The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
|
User |
getSharingUser()
The user who shared the file with the requesting user, if applicable.
|
Long |
getSize()
The size of the file's content in bytes.
|
List<String> |
getSpaces()
The list of spaces which contain the file.
|
Boolean |
getStarred()
Whether the user has starred the file.
|
String |
getTeamDriveId()
ID of the Team Drive the file resides in.
|
String |
getThumbnailLink()
A short-lived link to the file's thumbnail, if available.
|
Long |
getThumbnailVersion()
The thumbnail version for use in thumbnail cache invalidation.
|
Boolean |
getTrashed()
Whether the file has been trashed, either explicitly or from a trashed parent folder.
|
DateTime |
getTrashedTime()
The time that the item was trashed (RFC 3339 date-time).
|
User |
getTrashingUser()
If the file has been explicitly trashed, the user who trashed it.
|
Long |
getVersion()
A monotonically increasing version number for the file.
|
File.VideoMediaMetadata |
getVideoMediaMetadata()
Additional metadata about video media.
|
Boolean |
getViewedByMe()
Whether the file has been viewed by this user.
|
DateTime |
getViewedByMeTime()
The last time the file was viewed by the user (RFC 3339 date-time).
|
Boolean |
getViewersCanCopyContent()
Deprecated - use copyRequiresWriterPermission instead.
|
String |
getWebContentLink()
A link for downloading the content of the file in a browser.
|
String |
getWebViewLink()
A link for opening the file in a relevant Google editor or viewer in a browser.
|
Boolean |
getWritersCanShare()
Whether users with only writer permission can modify the file's permissions.
|
File |
set(String fieldName,
Object value) |
File |
setAppProperties(Map<String,String> appProperties)
A collection of arbitrary key-value pairs which are private to the requesting app.
|
File |
setCapabilities(File.Capabilities capabilities)
Capabilities the current user has on this file.
|
File |
setContentHints(File.ContentHints contentHints)
Additional information about the content of the file.
|
File |
setCopyRequiresWriterPermission(Boolean copyRequiresWriterPermission)
Whether the options to copy, print, or download this file, should be disabled for readers and
commenters.
|
File |
setCreatedTime(DateTime createdTime)
The time at which the file was created (RFC 3339 date-time).
|
File |
setDescription(String description)
A short description of the file.
|
File |
setExplicitlyTrashed(Boolean explicitlyTrashed)
Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent
folder.
|
File |
setFileExtension(String fileExtension)
The final component of fullFileExtension.
|
File |
setFolderColorRgb(String folderColorRgb)
The color for a folder as an RGB hex string.
|
File |
setFullFileExtension(String fullFileExtension)
The full file extension extracted from the name field.
|
File |
setHasAugmentedPermissions(Boolean hasAugmentedPermissions)
Whether any users are granted file access directly on this file.
|
File |
setHasThumbnail(Boolean hasThumbnail)
Whether this file has a thumbnail.
|
File |
setHeadRevisionId(String headRevisionId)
The ID of the file's head revision.
|
File |
setIconLink(String iconLink)
A static, unauthenticated link to the file's icon.
|
File |
setId(String id)
The ID of the file.
|
File |
setImageMediaMetadata(File.ImageMediaMetadata imageMediaMetadata)
Additional metadata about image media, if available.
|
File |
setIsAppAuthorized(Boolean isAppAuthorized)
Whether the file was created or opened by the requesting app.
|
File |
setKind(String kind)
Identifies what kind of resource this is.
|
File |
setLastModifyingUser(User lastModifyingUser)
The last user to modify the file.
|
File |
setMd5Checksum(String md5Checksum)
The MD5 checksum for the content of the file.
|
File |
setMimeType(String mimeType)
The MIME type of the file.
|
File |
setModifiedByMe(Boolean modifiedByMe)
Whether the file has been modified by this user.
|
File |
setModifiedByMeTime(DateTime modifiedByMeTime)
The last time the file was modified by the user (RFC 3339 date-time).
|
File |
setModifiedTime(DateTime modifiedTime)
The last time the file was modified by anyone (RFC 3339 date-time).
|
File |
setName(String name)
The name of the file.
|
File |
setOriginalFilename(String originalFilename)
The original filename of the uploaded content if available, or else the original value of the
name field.
|
File |
setOwnedByMe(Boolean ownedByMe)
Whether the user owns the file.
|
File |
setOwners(List<User> owners)
The owners of the file.
|
File |
setParents(List<String> parents)
The IDs of the parent folders which contain the file.
|
File |
setPermissionIds(List<String> permissionIds)
List of permission IDs for users with access to this file.
|
File |
setPermissions(List<Permission> permissions)
The full list of permissions for the file.
|
File |
setProperties(Map<String,String> properties)
A collection of arbitrary key-value pairs which are visible to all apps.
|
File |
setQuotaBytesUsed(Long quotaBytesUsed)
The number of storage quota bytes used by the file.
|
File |
setShared(Boolean shared)
Whether the file has been shared.
|
File |
setSharedWithMeTime(DateTime sharedWithMeTime)
The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
|
File |
setSharingUser(User sharingUser)
The user who shared the file with the requesting user, if applicable.
|
File |
setSize(Long size)
The size of the file's content in bytes.
|
File |
setSpaces(List<String> spaces)
The list of spaces which contain the file.
|
File |
setStarred(Boolean starred)
Whether the user has starred the file.
|
File |
setTeamDriveId(String teamDriveId)
ID of the Team Drive the file resides in.
|
File |
setThumbnailLink(String thumbnailLink)
A short-lived link to the file's thumbnail, if available.
|
File |
setThumbnailVersion(Long thumbnailVersion)
The thumbnail version for use in thumbnail cache invalidation.
|
File |
setTrashed(Boolean trashed)
Whether the file has been trashed, either explicitly or from a trashed parent folder.
|
File |
setTrashedTime(DateTime trashedTime)
The time that the item was trashed (RFC 3339 date-time).
|
File |
setTrashingUser(User trashingUser)
If the file has been explicitly trashed, the user who trashed it.
|
File |
setVersion(Long version)
A monotonically increasing version number for the file.
|
File |
setVideoMediaMetadata(File.VideoMediaMetadata videoMediaMetadata)
Additional metadata about video media.
|
File |
setViewedByMe(Boolean viewedByMe)
Whether the file has been viewed by this user.
|
File |
setViewedByMeTime(DateTime viewedByMeTime)
The last time the file was viewed by the user (RFC 3339 date-time).
|
File |
setViewersCanCopyContent(Boolean viewersCanCopyContent)
Deprecated - use copyRequiresWriterPermission instead.
|
File |
setWebContentLink(String webContentLink)
A link for downloading the content of the file in a browser.
|
File |
setWebViewLink(String webViewLink)
A link for opening the file in a relevant Google editor or viewer in a browser.
|
File |
setWritersCanShare(Boolean writersCanShare)
Whether users with only writer permission can modify the file's permissions.
|
getFactory, setFactory, toPrettyString, toString
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeys
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public Map<String,String> getAppProperties()
null
for nonepublic File setAppProperties(Map<String,String> appProperties)
appProperties
- appProperties or null
for nonepublic File.Capabilities getCapabilities()
null
for nonepublic File setCapabilities(File.Capabilities capabilities)
capabilities
- capabilities or null
for nonepublic File.ContentHints getContentHints()
null
for nonepublic File setContentHints(File.ContentHints contentHints)
contentHints
- contentHints or null
for nonepublic Boolean getCopyRequiresWriterPermission()
null
for nonepublic File setCopyRequiresWriterPermission(Boolean copyRequiresWriterPermission)
copyRequiresWriterPermission
- copyRequiresWriterPermission or null
for nonepublic DateTime getCreatedTime()
null
for nonepublic File setCreatedTime(DateTime createdTime)
createdTime
- createdTime or null
for nonepublic String getDescription()
null
for nonepublic File setDescription(String description)
description
- description or null
for nonepublic Boolean getExplicitlyTrashed()
null
for nonepublic File setExplicitlyTrashed(Boolean explicitlyTrashed)
explicitlyTrashed
- explicitlyTrashed or null
for nonepublic String getFileExtension()
null
for nonepublic File setFileExtension(String fileExtension)
fileExtension
- fileExtension or null
for nonepublic String getFolderColorRgb()
null
for nonepublic File setFolderColorRgb(String folderColorRgb)
folderColorRgb
- folderColorRgb or null
for nonepublic String getFullFileExtension()
null
for nonepublic File setFullFileExtension(String fullFileExtension)
fullFileExtension
- fullFileExtension or null
for nonepublic Boolean getHasAugmentedPermissions()
null
for nonepublic File setHasAugmentedPermissions(Boolean hasAugmentedPermissions)
hasAugmentedPermissions
- hasAugmentedPermissions or null
for nonepublic Boolean getHasThumbnail()
null
for nonepublic File setHasThumbnail(Boolean hasThumbnail)
hasThumbnail
- hasThumbnail or null
for nonepublic String getHeadRevisionId()
null
for nonepublic File setHeadRevisionId(String headRevisionId)
headRevisionId
- headRevisionId or null
for nonepublic String getIconLink()
null
for nonepublic File setIconLink(String iconLink)
iconLink
- iconLink or null
for nonepublic String getId()
null
for nonepublic File.ImageMediaMetadata getImageMediaMetadata()
null
for nonepublic File setImageMediaMetadata(File.ImageMediaMetadata imageMediaMetadata)
imageMediaMetadata
- imageMediaMetadata or null
for nonepublic Boolean getIsAppAuthorized()
null
for nonepublic File setIsAppAuthorized(Boolean isAppAuthorized)
isAppAuthorized
- isAppAuthorized or null
for nonepublic String getKind()
null
for nonepublic File setKind(String kind)
kind
- kind or null
for nonepublic User getLastModifyingUser()
null
for nonepublic File setLastModifyingUser(User lastModifyingUser)
lastModifyingUser
- lastModifyingUser or null
for nonepublic String getMd5Checksum()
null
for nonepublic File setMd5Checksum(String md5Checksum)
md5Checksum
- md5Checksum or null
for nonepublic String getMimeType()
null
for nonepublic File setMimeType(String mimeType)
mimeType
- mimeType or null
for nonepublic Boolean getModifiedByMe()
null
for nonepublic File setModifiedByMe(Boolean modifiedByMe)
modifiedByMe
- modifiedByMe or null
for nonepublic DateTime getModifiedByMeTime()
null
for nonepublic File setModifiedByMeTime(DateTime modifiedByMeTime)
modifiedByMeTime
- modifiedByMeTime or null
for nonepublic DateTime getModifiedTime()
null
for nonepublic File setModifiedTime(DateTime modifiedTime)
modifiedTime
- modifiedTime or null
for nonepublic String getName()
null
for nonepublic File setName(String name)
name
- name or null
for nonepublic String getOriginalFilename()
null
for nonepublic File setOriginalFilename(String originalFilename)
originalFilename
- originalFilename or null
for nonepublic Boolean getOwnedByMe()
null
for nonepublic File setOwnedByMe(Boolean ownedByMe)
ownedByMe
- ownedByMe or null
for nonepublic List<User> getOwners()
null
for nonepublic File setOwners(List<User> owners)
owners
- owners or null
for nonepublic List<String> getParents()
null
for nonepublic File setParents(List<String> parents)
parents
- parents or null
for nonepublic List<String> getPermissionIds()
null
for nonepublic File setPermissionIds(List<String> permissionIds)
permissionIds
- permissionIds or null
for nonepublic List<Permission> getPermissions()
null
for nonepublic File setPermissions(List<Permission> permissions)
permissions
- permissions or null
for nonepublic Map<String,String> getProperties()
null
for nonepublic File setProperties(Map<String,String> properties)
properties
- properties or null
for nonepublic Long getQuotaBytesUsed()
null
for nonepublic File setQuotaBytesUsed(Long quotaBytesUsed)
quotaBytesUsed
- quotaBytesUsed or null
for nonepublic Boolean getShared()
null
for nonepublic File setShared(Boolean shared)
shared
- shared or null
for nonepublic DateTime getSharedWithMeTime()
null
for nonepublic File setSharedWithMeTime(DateTime sharedWithMeTime)
sharedWithMeTime
- sharedWithMeTime or null
for nonepublic User getSharingUser()
null
for nonepublic File setSharingUser(User sharingUser)
sharingUser
- sharingUser or null
for nonepublic Long getSize()
null
for nonepublic File setSize(Long size)
size
- size or null
for nonepublic List<String> getSpaces()
null
for nonepublic File setSpaces(List<String> spaces)
spaces
- spaces or null
for nonepublic Boolean getStarred()
null
for nonepublic File setStarred(Boolean starred)
starred
- starred or null
for nonepublic String getTeamDriveId()
null
for nonepublic File setTeamDriveId(String teamDriveId)
teamDriveId
- teamDriveId or null
for nonepublic String getThumbnailLink()
null
for nonepublic File setThumbnailLink(String thumbnailLink)
thumbnailLink
- thumbnailLink or null
for nonepublic Long getThumbnailVersion()
null
for nonepublic File setThumbnailVersion(Long thumbnailVersion)
thumbnailVersion
- thumbnailVersion or null
for nonepublic Boolean getTrashed()
null
for nonepublic File setTrashed(Boolean trashed)
trashed
- trashed or null
for nonepublic DateTime getTrashedTime()
null
for nonepublic File setTrashedTime(DateTime trashedTime)
trashedTime
- trashedTime or null
for nonepublic User getTrashingUser()
null
for nonepublic File setTrashingUser(User trashingUser)
trashingUser
- trashingUser or null
for nonepublic Long getVersion()
null
for nonepublic File setVersion(Long version)
version
- version or null
for nonepublic File.VideoMediaMetadata getVideoMediaMetadata()
null
for nonepublic File setVideoMediaMetadata(File.VideoMediaMetadata videoMediaMetadata)
videoMediaMetadata
- videoMediaMetadata or null
for nonepublic Boolean getViewedByMe()
null
for nonepublic File setViewedByMe(Boolean viewedByMe)
viewedByMe
- viewedByMe or null
for nonepublic DateTime getViewedByMeTime()
null
for nonepublic File setViewedByMeTime(DateTime viewedByMeTime)
viewedByMeTime
- viewedByMeTime or null
for nonepublic Boolean getViewersCanCopyContent()
null
for nonepublic File setViewersCanCopyContent(Boolean viewersCanCopyContent)
viewersCanCopyContent
- viewersCanCopyContent or null
for nonepublic String getWebContentLink()
null
for nonepublic File setWebContentLink(String webContentLink)
webContentLink
- webContentLink or null
for nonepublic String getWebViewLink()
null
for nonepublic File setWebViewLink(String webViewLink)
webViewLink
- webViewLink or null
for nonepublic Boolean getWritersCanShare()
null
for nonepublic File setWritersCanShare(Boolean writersCanShare)
writersCanShare
- writersCanShare or null
for nonepublic File set(String fieldName, Object value)
set
in class GenericJson
public File clone()
clone
in class GenericJson