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: https://developers.google.com/api-client-library/java/google-http-java-client/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.LabelInfo
An overview of the labels on the file.
|
static class |
File.LinkShareMetadata
Contains details about the link URLs that clients are using to refer to this item.
|
static class |
File.ShortcutDetails
Shortcut file details.
|
static class |
File.VideoMediaMetadata
Additional metadata about video media.
|
GenericData.FlagsAbstractMap.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.
|
List<ContentRestriction> |
getContentRestrictions()
Restrictions for accessing 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.
|
String |
getDriveId()
ID of the shared drive the file resides in.
|
Boolean |
getExplicitlyTrashed()
Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent
folder.
|
Map<String,String> |
getExportLinks()
Links for exporting Docs Editors files to specific formats.
|
String |
getFileExtension()
The final component of fullFileExtension.
|
String |
getFolderColorRgb()
The color for a folder or shortcut to a folder as an RGB hex string.
|
String |
getFullFileExtension()
The full file extension extracted from the name field.
|
Boolean |
getHasAugmentedPermissions()
Whether there are permissions 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.
|
File.LabelInfo |
getLabelInfo()
An overview of the labels on the file.
|
User |
getLastModifyingUser()
The last user to modify the file.
|
File.LinkShareMetadata |
getLinkShareMetadata()
Contains details about the link URLs that clients are using to refer to this item.
|
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 owner of this 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.
|
String |
getResourceKey()
A key needed to access the item via a shared link.
|
String |
getSha1Checksum()
The SHA1 checksum associated with this file, if available.
|
String |
getSha256Checksum()
The SHA256 checksum associated with this file, if available.
|
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.
|
File.ShortcutDetails |
getShortcutDetails()
Shortcut file details.
|
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()
Deprecated - use driveId instead.
|
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 |
setContentRestrictions(List<ContentRestriction> contentRestrictions)
Restrictions for accessing 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 |
setDriveId(String driveId)
ID of the shared drive the file resides in.
|
File |
setExplicitlyTrashed(Boolean explicitlyTrashed)
Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent
folder.
|
File |
setExportLinks(Map<String,String> exportLinks)
Links for exporting Docs Editors files to specific formats.
|
File |
setFileExtension(String fileExtension)
The final component of fullFileExtension.
|
File |
setFolderColorRgb(String folderColorRgb)
The color for a folder or shortcut to 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 there are permissions 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 |
setLabelInfo(File.LabelInfo labelInfo)
An overview of the labels on the file.
|
File |
setLastModifyingUser(User lastModifyingUser)
The last user to modify the file.
|
File |
setLinkShareMetadata(File.LinkShareMetadata linkShareMetadata)
Contains details about the link URLs that clients are using to refer to this item.
|
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 owner of this 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 |
setResourceKey(String resourceKey)
A key needed to access the item via a shared link.
|
File |
setSha1Checksum(String sha1Checksum)
The SHA1 checksum associated with this file, if available.
|
File |
setSha256Checksum(String sha256Checksum)
The SHA256 checksum associated with this file, if available.
|
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 |
setShortcutDetails(File.ShortcutDetails shortcutDetails)
Shortcut file details.
|
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)
Deprecated - use driveId instead.
|
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, toStringentrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeysclear, containsKey, containsValue, isEmpty, keySet, size, valuesfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic 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 List<ContentRestriction> getContentRestrictions()
null for nonepublic File setContentRestrictions(List<ContentRestriction> contentRestrictions)
contentRestrictions - contentRestrictions 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 String getDriveId()
null for nonepublic File setDriveId(String driveId)
driveId - driveId or null for nonepublic Boolean getExplicitlyTrashed()
null for nonepublic File setExplicitlyTrashed(Boolean explicitlyTrashed)
explicitlyTrashed - explicitlyTrashed or null for nonepublic Map<String,String> getExportLinks()
null for nonepublic File setExportLinks(Map<String,String> exportLinks)
exportLinks - exportLinks 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 File.LabelInfo getLabelInfo()
null for nonepublic File setLabelInfo(File.LabelInfo labelInfo)
labelInfo - labelInfo or null for nonepublic User getLastModifyingUser()
null for nonepublic File setLastModifyingUser(User lastModifyingUser)
lastModifyingUser - lastModifyingUser or null for nonepublic File.LinkShareMetadata getLinkShareMetadata()
null for nonepublic File setLinkShareMetadata(File.LinkShareMetadata linkShareMetadata)
linkShareMetadata - linkShareMetadata 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 String getResourceKey()
null for nonepublic File setResourceKey(String resourceKey)
resourceKey - resourceKey or null for nonepublic String getSha1Checksum()
null for nonepublic File setSha1Checksum(String sha1Checksum)
sha1Checksum - sha1Checksum or null for nonepublic String getSha256Checksum()
null for nonepublic File setSha256Checksum(String sha256Checksum)
sha256Checksum - sha256Checksum 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 File.ShortcutDetails getShortcutDetails()
null for nonepublic File setShortcutDetails(File.ShortcutDetails shortcutDetails)
shortcutDetails - shortcutDetails 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 GenericJsonpublic File clone()
clone in class GenericJsonCopyright © 2011–2022 Google. All rights reserved.