File class

The metadata for a file.

Constructors

File()
File.fromJson(Map _json)

Properties

A link for opening the file in a relevant Google editor or viewer.
read / write
appDataContents ↔ bool
Whether this file is in the Application Data folder.
read / write
canComment ↔ bool
Deprecated: use capabilities/canComment.
read / write
canReadRevisions ↔ bool
Deprecated: use capabilities/canReadRevisions.
read / write
capabilities FileCapabilities
Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.
read / write
copyable ↔ bool
Deprecated: use capabilities/canCopy.
read / write
copyRequiresWriterPermission ↔ bool
Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
read / write
createdDate ↔ DateTime
Create time for this file (formatted RFC 3339 timestamp).
read / write
A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
read / write
description ↔ String
A short description of the file.
read / write
downloadUrl ↔ String
Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files.
read / write
driveId ↔ String
ID of the shared drive the file resides in. Only populated for items in shared drives.
read / write
editable ↔ bool
Deprecated: use capabilities/canEdit.
read / write
A link for embedding the file.
read / write
etag ↔ String
ETag of the file.
read / write
explicitlyTrashed ↔ bool
Whether this file has been explicitly trashed, as opposed to recursively trashed.
read / write
Links for exporting Google Docs to specific formats.
read / write
fileExtension ↔ String
The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files.
read / write
fileSize ↔ String
The size of the file in bytes. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files.
read / write
folderColorRgb ↔ String
Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for items in shared drives.
read / write
fullFileExtension ↔ String
The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files.
read / write
hasAugmentedPermissions ↔ bool
Whether any users are granted file access directly on this file. This field is only populated for items in shared drives.
read / write
hasThumbnail ↔ bool
Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field.
read / write
headRevisionId ↔ String
The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files.
read / write
A link to the file's icon.
read / write
id ↔ String
The ID of the file.
read / write
imageMediaMetadata FileImageMediaMetadata
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.
read / write
indexableText FileIndexableText
Indexable text attributes for the file (can only be written)
read / write
isAppAuthorized ↔ bool
Whether the file was created or opened by the requesting app.
read / write
kind ↔ String
The type of file. This is always drive#file.
read / write
labels FileLabels
A group of labels for the file.
read / write
lastModifyingUser User
The last user to modify this file.
read / write
lastModifyingUserName ↔ String
Name of the last user to modify this file.
read / write
lastViewedByMeDate ↔ DateTime
Last time this file was viewed by the user (formatted RFC 3339 timestamp).
read / write
markedViewedByMeDate ↔ DateTime
Deprecated.
read / write
md5Checksum ↔ String
An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files.
read / write
mimeType ↔ String
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.
read / write
modifiedByMeDate ↔ DateTime
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.
read / write
modifiedDate ↔ DateTime
Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
read / write
A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
read / write
originalFilename ↔ String
The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Google Drive.
read / write
ownedByMe ↔ bool
Whether the file is owned by the current user. Not populated for items in shared drives.
read / write
ownerNames ↔ List<String>
Name(s) of the owner(s) of this file. Not populated for items in shared drives.
read / write
owners ↔ List<User>
The owner(s) of this file. Not populated for items in shared drives.
read / write
parents ↔ List<ParentReference>
Collection of parent folders which contain this file. If not specified as part of an insert request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests can also use the addParents and removeParents parameters to modify the parents list.
read / write
permissionIds ↔ List<String>
List of permission IDs for users with access to this file.
read / write
permissions ↔ List<Permission>
The list of permissions for users with access to this file. Not populated for items in shared drives.
read / write
properties ↔ List<Property>
The list of properties.
read / write
quotaBytesUsed ↔ String
The number of quota bytes used by this file.
read / write
A link back to this file.
read / write
shareable ↔ bool
Deprecated: use capabilities/canShare.
read / write
shared ↔ bool
Whether the file has been shared. Not populated for items in shared drives.
read / write
sharedWithMeDate ↔ DateTime
Time at which this file was shared with the user (formatted RFC 3339 timestamp).
read / write
sharingUser User
User that shared the item with the current user, if available.
read / write
spaces ↔ List<String>
The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
read / write
teamDriveId ↔ String
Deprecated - use driveId instead.
read / write
thumbnail FileThumbnail
A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated.
read / write
A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
read / write
thumbnailVersion ↔ String
The thumbnail version for use in thumbnail cache invalidation.
read / write
title ↔ String
The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant.
read / write
trashedDate ↔ DateTime
The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives.
read / write
trashingUser User
If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives.
read / write
userPermission Permission
The permissions for the authenticated user on this file.
read / write
version ↔ String
A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
read / write
videoMediaMetadata FileVideoMediaMetadata
Metadata about video media. This will only be present for video types.
read / write
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.
read / write
A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
read / write
writersCanShare ↔ bool
Whether writers can share the document with other users. Not populated for items in shared drives.
read / write
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

toJson() → Map<String, Object>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited