File class

The metadata for a file.

Constructors

File()
File.fromJson(Map _json)

Properties

appProperties ↔ Map<String, String>
A collection of arbitrary key-value pairs which are private to the requesting app. Entries with null values are cleared in update and copy requests.
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
contentHints FileContentHints
Additional information about the content of the file. These fields are never populated in responses.
read / write
copyRequiresWriterPermission ↔ bool
Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
read / write
createdTime ↔ DateTime
The time at which the file was created (RFC 3339 date-time).
read / write
description ↔ String
A short description of the file.
read / write
driveId ↔ String
ID of the shared drive the file resides in. Only populated for items in shared drives.
read / write
explicitlyTrashed ↔ bool
Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
read / write
Links for exporting Google Docs to specific formats.
read / write
fileExtension ↔ String
The final component of fullFileExtension. This is only available for files with binary content in Google Drive.
read / write
folderColorRgb ↔ String
The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource. If an unsupported color is specified, the closest color in the palette will be used instead.
read / write
fullFileExtension ↔ String
The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Google Drive. This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
read / write
hasAugmentedPermissions ↔ bool
Whether any users are granted file access directly on this file. This field is only populated for shared drive files.
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 is currently only available for files with binary content in Google Drive.
read / write
A static, unauthenticated link to the file's icon.
read / write
id ↔ String
The ID of the file.
read / write
imageMediaMetadata FileImageMediaMetadata
Additional metadata about image media, if available.
read / write
isAppAuthorized ↔ bool
Whether the file was created or opened by the requesting app.
read / write
kind ↔ String
Identifies what kind of resource this is. Value: the fixed string "drive#file".
read / write
lastModifyingUser User
The last user to modify the file.
read / write
md5Checksum ↔ String
The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.
read / write
mimeType ↔ String
The MIME type of the file. Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded. If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.
read / write
modifiedByMe ↔ bool
Whether the file has been modified by this user.
read / write
modifiedByMeTime ↔ DateTime
The last time the file was modified by the user (RFC 3339 date-time).
read / write
modifiedTime ↔ DateTime
The last time the file was modified by anyone (RFC 3339 date-time). Note that setting modifiedTime will also update modifiedByMeTime for the user.
read / write
name ↔ String
The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant.
read / write
originalFilename ↔ String
The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Google Drive.
read / write
ownedByMe ↔ bool
Whether the user owns the file. Not populated for items in shared drives.
read / write
owners ↔ List<User>
The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives.
read / write
parents ↔ List<String>
The IDs of the parent folders which contain the file. If not specified as part of a create 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 must 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 full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for items in shared drives.
read / write
properties ↔ Map<String, String>
A collection of arbitrary key-value pairs which are visible to all apps. Entries with null values are cleared in update and copy requests.
read / write
quotaBytesUsed ↔ String
The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.
read / write
shared ↔ bool
Whether the file has been shared. Not populated for items in shared drives.
read / write
sharedWithMeTime ↔ DateTime
The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
read / write
sharingUser User
The user who shared the file with the requesting user, if applicable.
read / write
size ↔ String
The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive.
read / write
spaces ↔ List<String>
The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
read / write
starred ↔ bool
Whether the user has starred the file.
read / write
teamDriveId ↔ String
Deprecated - use driveId instead.
read / write
A short-lived link to the file's thumbnail, if available. 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
trashed ↔ bool
Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
read / write
trashedTime ↔ DateTime
The time that the item was trashed (RFC 3339 date-time). 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
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 user.
read / write
videoMediaMetadata FileVideoMediaMetadata
Additional metadata about video media. This may not be available immediately upon upload.
read / write
viewedByMe ↔ bool
Whether the file has been viewed by this user.
read / write
viewedByMeTime ↔ DateTime
The last time the file was viewed by the user (RFC 3339 date-time).
read / write
viewersCanCopyContent ↔ bool
Deprecated - use copyRequiresWriterPermission instead.
read / write
A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive.
read / write
A link for opening the file in a relevant Google editor or viewer in a browser.
read / write
writersCanShare ↔ bool
Whether users with only writer permission can modify the file's permissions. 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