目录

File

Class Info

public final class File extends GenericJson

File metadata class.

Nested Class Summary

Qualifier and Type

Class Name and Description

static final Class

File.Capabilities

Declaration of the File.Capabilities class, a class of the current user's permissions for the current file. Each permission corresponds to an action that can be taken by the user.

static final Class

File.ContentExtras

Declaration of the File.ContentExtras class, a class of additional information about file content. The additional information is optional and is not contained in the response.

static final Class

File.PictureMetadata

Declaration of the File.PictureMetadata class, a class of additional metadata of media files.

static final Class

File.VideoMetadata

Declaration of the File.VideoMetadata class, a class of additional video media metadata.

Public Constructor Summary

Constructor Name

File()

Constructs a File object.

Public Method Summary

Qualifier and Type

Method Name and Description

File

clone()

Clones a File object.

Map<String, String>

getAppSettings()

Obtains custom file attributes that are private to the requesting app.

File.Capabilities

getCapabilities()

Obtains the current user's permissions for the file. Each permission corresponds to an action that can be taken by the user.

String

getCategory()

Obtains the resource type.

List<String>

getContainers()

Obtains the types of space that may contain the file. The options include drive and applicationData.

String

getContentDownloadLink()

Obtains the link for downloading the file in a browser.

File.ContentExtras

getContentExtras()

Obtains additional information about file content.

String

getContentVersion()

Obtains the version number of the entity file content.

DateTime

getCreatedTime()

Obtains the time when the file or folder is created, in RFC 3339 date-time format.

String

getDescription()

Obtains the short description of the file or folder.

Boolean

getDirectlyRecycled()

Checks whether the file is directly moved to the recycle bin rather than deleted from its parent folder recursively.

Boolean

getEditedByMe()

Checks whether the file is modified by the current user.

DateTime

getEditedByMeTime()

Obtains the last time when the file is modified by the current user.

DateTime

getEditedTime()

Obtains the last time when the file or folder is modified, in RFC 3339 date-time format.

Boolean

getExistThumbnail()

Checks whether the file has a thumbnail.

Boolean

getFavorite()

Checks whether the file or folder is marked.

String

getFileName()

Obtains the name of the file or folder.

String

getFileSuffix()

Obtains the full file name extension.

String

getFullFileSuffix()

Obtains the full file name suffix extracted from the fileName field.

Boolean

getHasShared()

Checks whether the file is shared.

String

getIconDownloadLink()

Obtains the link to the icon of the file.

String

getId()

Obtains the ID of the file or folder.

Boolean

getIsAppAuthorized()

Checks whether the file is created or opened by the requesting app.

User

getLastEditor()

Obtains information about the last user who modifies the file.

String

getLastHistoryVersionId()

Obtains the latest file version ID.

String

getMimeType()

Obtains the MIME type of the file or folder.

Long

getOccupiedSpace()

Obtains the storage space occupied by the file.

String

getOnLineViewLink()

Obtains the link to preview files online in a browser.

String

getOriginalFilename()

Obtains the original file name.

Boolean

getOwnedByMe()

Checks whether the user owns the file.

List<User>

getOwners()

Obtains the users to whom the file or folder belongs.

List<String>

getParentFolder()

Obtains the parent folder ID of the file.

List<String>

getPermissionIds()

Obtains the IDs of permissions for users to access the file.

List<Permission>

getPermissions()

Obtains the list of all permissions for the file. Only the user who shares the file has the permissions, and users who access the file on the drive do not.

File.PictureMetadata

getPictureMetadata()

Obtains the additional metadata of a media file.

Map<String, String>

getProperties()

Obtains custom file attributes that are visible to all apps.

Boolean

getRecycled()

Checks whether the file or folder has been moved to the recycle bin.

DateTime

getRecycledTime()

Obtains the time when the file is moved to the recycle bin.

User

getRecyclingUser()

Obtains the user who moves the file to the recycle bin.

String

getSha256()

Obtains the SHA-256 value for verifying the file.

User

getSharer()

Obtains the user who shares the file.

DateTime

getSharedWithMeTime()

Obtains the time when the file is shared by a user.

Long

getSize()

Obtains the size of the file. The size attribute is applicable only to files.

String

getSmallThumbnailDownloadLink()

Obtains the link to the small thumbnail of the file.

String

getThumbnailDownloadLink()

Obtains the link to the thumbnail of the file.

Long

getThumbnailVersion()

Obtains the thumbnail version number.

Long

getVersion()

Obtains the increasing version number of a file.

File.VideoMetadata

getVideoMetadata()

Obtains additional video media metadata.

Boolean

getWritersHasSharePermission()

Checks whether a user who has only the write permission for the file can modify the file.

Boolean

getWriterHasCopyPermission()

Checks whether readers and commenters of the file have the copy, print, and download permissions for the file.

File

set(String fieldName, Object value)

Sets a custom attribute and its value.

File

setAppSettings(Map<String, String> appSettings)

Sets custom file attributes that are private to the requesting app.

File

setCapabilities(Capabilities capabilities)

Sets the current user's permissions for the file. Each permission corresponds to an action that can be taken by the user.

File

setCategory(String category)

Sets the resource type. The value is always drive#file.

File

setContainers(List<String> containers)

Sets the types of space that may contain the file. The options include drive and applicationData.

File

setContentDownloadLink(String contentDownloadLink)

Sets the link for downloading the file in a browser.

File

setContentExtras(ContentExtras contentExtras)

Sets additional information about file content.

File

setContentVersion(String contentVersion)

Sets the version number of the entity file content.

File

setCreatedTime(DateTime createdTime)

Sets the time when the file or folder is created, in RFC 3339 date-time format.

File

setDescription(String description)

Sets the short description of the file or folder.

File

setDirectlyRecycled(Boolean directlyRecycled)

Sets whether the file is directly moved to the recycle bin rather than deleted from its parent folder recursively.

File

setEditedByMe(Boolean editedByMe)

Sets whether the file is modified by the current user.

File

setEditedByMeTime(DateTime editedByMeTime)

Sets the last time when the file is modified by the current user, in RFC 3339 date-time format.

File

setEditedTime(DateTime editedTime)

Sets the last time when the file or folder is modified, in RFC 3339 date-time format.

File

setExistThumbnail(Boolean existThumbnail)

Sets whether the file has a thumbnail.

File

setFavorite(Boolean favorite)

Sets whether the file or folder is marked.

File

setFileName(String fileName)

Sets the name of the file or folder.

File

setFileSuffix(String fileSuffix)

Sets the full file name extension.

File

setFullFileSuffix(String fullFileSuffix)

Sets the full file name extension extracted from the fileName field.

File

setHasShared(Boolean hasShared)

Sets whether the file is shared.

File

setIconDownloadLink(String iconDownloadLink)

Sets the link to the icon of the file.

File

setId(String id)

Sets the ID of the file or folder.

File

setIsAppAuthorized(Boolean isAppAuthorized)

Sets whether the file is created or opened by the requesting app.

File

setLastEditor(User lastEditor)

Sets information about the last user who modifies the file.

File

setLastHistoryVersionId(String lastHistoryVersionId)

Sets the latest file version ID.

File

setMimeType(String mimeType)

Sets the MIME type of the file or folder.

File

setOccupiedSpace(Long occupiedSpace)

Sets the storage space occupied by the file.

File

setOnLineViewLink(String onLineViewLink)

Sets the link to preview files online in a browser.

File

setOriginalFilename(String originalFilename)

Sets the original file name.

File

setOwnedByMe(Boolean ownedByMe)

Sets whether the user owns the file.

File

setOwners(List<User> owners)

Sets the users to whom the file or folder belongs.

File

setParentFolder(List<String> parentFolder)

Sets the parent folder ID of the file.

File

setPermissionIds(List<String> permissionIds)

Sets the IDs of permissions for users to access the file.

File

setPermissions(List<Permission> permissions)

Sets the list of all permissions for the file.

File

setPictureMetadata(File.PictureMetadata pictureMetadata)

Sets the additional metadata of a media file.

File

setProperties(Map<String, String> properties)

Sets custom file attributes that are visible to all apps.

File

setRecycled(Boolean recycled)

Sets whether the file or folder has been moved to the recycle bin.

File

setRecycledTime(DateTime recycledTime)

Sets the time when a file is moved to the recycle bin, in RFC 3339 date-time format.

File

setRecyclingUser(User recyclingUser)

Sets the user who moves the file to the recycle bin.

File

setSharedWithMeTime(DateTime sharedWithMeTime)

Sets the time when the file is shared by a user, in RFC 3339 date-time format.

File

setSha256(String sha256)

Sets the SHA-256 value for verifying the file.

File

setSharer(User sharer)

Sets the user who shares the file.

File

setSize(Long size)

Sets the size of the file. The size attribute is applicable only to files.

File

setSmallThumbnailDownloadLink(String smallThumbnailDownloadLink)

Sets the link to the small thumbnail of the file. The link is set only when the requesting app has the permission to access the file content.

File

setThumbnailDownloadLink(String thumbnailDownloadLink)

Sets the link to the thumbnail of the file. The link is set only when the requesting app has the permission to access the file content.

File

setThumbnailVersion(Long thumbnailVersion)

Sets the thumbnail version number.

File

setVersion(Long version)

Sets the increasing version number of a file.

File

setVideoMetadata(File.VideoMetadata videoMetadata)

Sets additional video media metadata.

File

setWriterHasCopyPermission(Boolean writerHasCopyPermission)

Sets whether readers and commenters of the file have the copy, print, and download permissions for the file.

File

setWritersHasSharePermission(Boolean writersHasSharePermission)

Sets whether a user who has only the write permission for the file can modify the file.

Public Constructors

[h2]File

Constructor

File()

Constructs a File object.

Public Methods

[h2]getCategory

Method

public String getCategory()

Obtains the resource type.

Returns

Type

Description

String

Resource type. The value is always drive#file.

[h2]setCategory

Method

public File setCategory(String category)

Sets the resource type. The value is always drive#file.

Parameters

Name

Description

category

Resource type. The value is always drive#file.

Returns

Type

Description

File

A File object.

[h2]getId

Method

public String getId()

Obtains the unique ID of the file or folder.

Returns

Type

Description

String

Unique ID of the file or folder.

[h2]setId

Method

public File setId(String id)

Sets the unique ID of the file or folder.

Parameters

Name

Description

id

Unique ID of the file or folder.

Returns

Type

Description

File

A File object.

[h2]getFileName

Method

public String getFileName()

Obtains the name of the file or folder.

Returns

Type

Description

String

File or folder name.

[h2]setFileName

Method

public File setFileName(String fileName)

Sets the name of the file or folder.

Parameters

Name

Description

fileName

File or folder name, which cannot contain any of the following characters:

\ / : * ? " < > |

Returns

Type

Description

File

A File object.

[h2]getSize

Method

public Long getSize()

Obtains the size of the file. The size attribute is applicable only to files.

Returns

Type

Description

Long

File size.

[h2]setSize

Method

public File setSize(Long size)

Sets the size of the file. The size attribute is applicable only to files.

Parameters

Name

Description

size

File size.

Returns

Type

Description

File

A File object.

[h2]getMimeType

Method

public String getMimeType()

Obtains the MIME type of the file or folder.

Returns

Type

Description

String

MIME type of the file or folder.

[h2]setMimeType

Method

public File setMimeType(String mimeType)

Sets the MIME type of the file or folder.

Parameters

Name

Description

mimeType

MIME type of the file or folder. For details, see the MIME type of the HTTP transmission protocol.

Note: The value of mimeType is always application/vnd.huawei.apps.folder for a folder.

Returns

Type

Description

File

A File object.

[h2]getParentFolder

Method

public List<String> getParentFolder()

Obtains the parent folder ID of the file.

Returns

Type

Description

List<String>

IDs of the parent folders of the file.

[h2]setParentFolder

Method

public File setParentFolder(List<String> parentFolder)

Sets the parent folder ID of the file.

Parameters

Name

Description

parentFolder

IDs of the parent folders of the file. The list structure is retained to ensure API compatibility. Only the first ID in the list is processed.

Returns

Type

Description

File

A File object.

[h2]getCreatedTime

Method

public DateTime getCreatedTime()

Obtains the time when the file or folder is created, in RFC 3339 date-time format.

Returns

Type

Description

DateTime

Time when the file or folder is created, in RFC 3339 date-time format.

[h2]setCreatedTime

Method

public File setCreatedTime(DateTime createdTime)

Sets the time when the file or folder is created, in RFC 3339 date-time format.

Parameters

Name

Description

createdTime

Time when the file or folder is created, in RFC 3339 date-time format.

Returns

Type

Description

File

A File object.

[h2]getEditedTime

Method

public DateTime getEditedTime()

Obtains the last time when the file or folder is modified, in RFC 3339 date-time format.

Returns

Type

Description

DateTime

Last modification time of the file or folder, in RFC 3339 date-time format.

[h2]setEditedTime

Method

public File setEditedTime(DateTime editedTime)

Sets the last time when the file or folder is modified, in RFC 3339 date-time format.

Parameters

Name

Description

editedTime

Last modification time of the file or folder, in RFC 3339 date-time format.

Returns

Type

Description

File

A File object.

[h2]getDescription

Method

public String getDescription()

Obtains the short description of the file or folder.

Returns

Type

Description

String

Short description of the file or folder.

[h2]setDescription

Method

public File setDescription(String description)

Sets the short description of the file or folder.

Parameters

Name

Description

description

Short description of the file or folder.

Returns

Type

Description

File

A File object.

[h2]getOwners

Method

public List<User> getOwners()

Obtains the users to whom the file or folder belongs.

Returns

Type

Description

List<User>

Users to whom the file or folder belongs.

[h2]setOwners

Method

public File setOwners(List<User> owners)

Sets the users to whom the file or folder belongs.

Parameters

Name

Description

owners

Users to whom the file or folder belongs.

Returns

Type

Description

File

A File object.

[h2]getFavorite

Method

public Boolean getFavorite()

Checks whether the file or folder is marked.

Returns

Type

Description

Boolean

Sets whether the file or folder is marked.

[h2]setFavorite

Method

public File setFavorite(Boolean favorite)

Sets whether the file or folder is marked.

Parameters

Name

Description

favorite

Indicates whether the file or folder is marked. true if the file or folder is marked; false otherwise.

Returns

Type

Description

File

A File object.

[h2]getRecycled

Method

public Boolean getRecycled()

Checks whether the file or folder has been moved to the recycle bin.

Returns

Type

Description

Boolean

Indicates whether the file or folder has been moved to the recycle bin.

[h2]setRecycled

Method

public File setRecycled(Boolean recycled)

Sets whether the file or folder has been moved to the recycle bin.

Parameters

Name

Description

recycled

Indicates whether the file or folder has been moved to the recycle bin.

  • true: The file or folder has been moved to the recycle bin.
  • false: The file or folder has not been moved to the recycle bin.

Note: Only the owner has the permission to perform this operation.

Returns

Type

Description

File

A File object.

[h2]getAppSettings

Method

public Map<String, String> getAppSettings()

Obtains custom file attributes that are private to the requesting app.

Returns

Type

Description

Map<String, String>

Custom file attributes.

[h2]setAppSettings

Method

public File setAppSettings(Map<String, String> appSettings)

Sets custom file attributes that are private to the requesting app.

Parameters

Name

Description

appSettings

Custom file attributes. The value is a collection of key-value pairs that are private to the requesting app.

Returns

Type

Description

File

A File object.

[h2]getProperties

Method

public Map<String, String> getProperties()

Obtains custom file attributes that are visible to all apps.

Returns

Type

Description

Map<String, String>

Custom file attributes.

[h2]setProperties

Method

public File setProperties(Map<String, String> properties)

Sets custom file attributes that are visible to all apps.

Parameters

Name

Description

properties

Custom file attributes. The value is a collection of key-value pairs that are visible to all apps.

Returns

Type

Description

File

A File object.

[h2]getCapabilities

Method

public File.Capabilities getCapabilities()

Obtains the current user's permissions for the file. Each permission corresponds to an action that can be taken by the user.

Returns

Type

Description

File.Capabilities

A File.Capabilities object.

[h2]setCapabilities

Method

public File setCapabilities(Capabilities capabilities)

Sets the current user's permissions for the file.

Parameters

Name

Description

capabilities

Current user's permissions for the file.

Returns

Type

Description

File

A File object.

[h2]getContentExtras

Method

public File.ContentExtras getContentExtras()

Obtains additional information about file content. The additional information is optional and is not contained in the response.

Returns

Type

Description

File.ContentExtras

A File.ContentExtras object.

[h2]setContentExtras

Method

public File setContentExtras(ContentExtras contentExtras)

Sets additional information about file content.

Parameters

Name

Description

contentExtras

Additional information about file content.

Returns

Type

Description

File

A File object.

[h2]getWriterHasCopyPermission

Method

public Boolean getWriterHasCopyPermission()

Checks whether readers and commenters of the file have the copy, print, and download permissions for the file.

Returns

Type

Description

Boolean

Whether readers and commenters of the file have the copy, print, and download permissions for the file.

  • true: Readers and commenters do not have the permissions.
  • false: Readers and commenters have the permissions.
  • null: Whether readers and commenters have the permissions is not set.

[h2]setWriterHasCopyPermission

Method

public File setWriterHasCopyPermission(Boolean writerHasCopyPermission)

Sets whether readers and commenters of the file have the copy, print, and download permissions for the file.

Parameters

Name

Description

writerHasCopyPermission

Indicates whether readers and commenters of the file have the copy, print, and download permissions for the file.

  • true: Readers and commenters do not have the permissions.
  • false: Readers and commenters have the permissions.
  • null: Whether readers and commenters have the permissions is not set.

Returns

Type

Description

File

A File object.

[h2]getDirectlyRecycled

Method

public Boolean getDirectlyRecycled()

Checks whether the file is directly moved to the recycle bin rather than deleted from its parent folder recursively.

Returns

Type

Description

Boolean

Whether the file is directly moved to the recycle bin rather than deleted from its parent folder recursively.

  • True: The file is directly moved to the recycle bin.
  • false: The file is deleted from its parent folder recursively.
  • null: Whether the file is directly moved to the recycle bin is not set.

[h2]setDirectlyRecycled

Method

public File setDirectlyRecycled(Boolean directlyRecycled)

Sets whether the file is directly moved to the recycle bin rather than deleted from its parent folder recursively.

Parameters

Name

Description

directlyRecycled

Indicates whether the file has been explicitly moved to the recycle bin.

Returns

Type

Description

File

A File object.

[h2]getFileSuffix

Method

public String getFileSuffix()

Obtains the final component of the full file name suffix. Full file name suffixes apply only to files with binary content in HUAWEI Drive Kit.

Returns

Type

Description

String

Final component of the full file name suffix.

[h2]setFileSuffix

Method

public File setFileSuffix(String fileSuffix)

Sets the final component of the full file name suffix. Full file name suffixes apply only to files with binary content in HUAWEI Drive Kit.

Parameters

Name

Description

fileSuffix

Final component of the full file name suffix.

Returns

Type

Description

File

A File object.

[h2]getFullFileSuffix

Method

public String getFullFileSuffix()

Obtains the full file name suffix extracted from the name field. The full file name suffix may contain multiple concatenated suffixes, for example, tar.gz. Full file name suffixes apply only to files with binary content in HUAWEI Drive Kit. When the value of name changes, the full file name suffix automatically changes. If the new file name does not contain a valid file name suffix, the original full file name suffix is retained.

Returns

Type

Description

String

Full file name suffix. The full file name suffix may contain multiple concatenated suffixes, for example, tar.gz.

[h2]setFullFileSuffix

Method

public File setFullFileSuffix(String fullFileSuffix)

Sets the full file name suffix extracted from the name field. The full file name suffix may contain multiple concatenated suffixes, for example, tar.gz. When the value of name changes, the full file name suffix automatically changes. If the new file name does not contain a valid file name suffix, the original full file name suffix is retained.

Parameters

Name

Description

fullfileSuffix

Full file name suffix extracted from the name field. The full file name suffix may contain multiple concatenated suffixes, for example, tar.gz.

Returns

Type

Description

File

A File object.

[h2]getExistThumbnail

Method

public Boolean getExistThumbnail()

Checks whether the file has a thumbnail.

Returns

Type

Description

Boolean

Whether the file has a thumbnail.

  • true: yes
  • false: no

[h2]setExistThumbnail

Method

public File setExistThumbnail(Boolean existThumbnail)

Sets whether the file has a thumbnail.

Parameters

Name

Description

existThumbnail

Indicates whether the file has a thumbnail. The value is a Boolean value.

Returns

Type

Description

File

A File object.

[h2]getIconDownloadLink

Method

public String getIconDownloadLink()

Obtains the link to the static unauthorized icon of the file.

Returns

Type

Description

String

Link to the static unauthorized icon of the file.

[h2]setIconDownloadLink

Method

public File setIconDownloadLink(String iconDownloadLink)

Sets the link to the icon of the file.

Parameters

Name

Description

iconDownloadLink

Link to the icon of the file.

Returns

Type

Description

File

A File object.

[h2]getPictureMetadata

Method

public File.PictureMetadata getPictureMetadata()

Obtains the additional metadata of a media file.

Returns

Type

Description

File.PictureMetadata

Additional metadata of a media file.

[h2]setPictureMetadata

Method

public File setPictureMetadata(PictureMetadata pictureMetadata)

Sets the additional metadata of a media file.

Parameters

Name

Description

pictureMetadata

Additional metadata of a media file.

Returns

Type

Description

File

A File object.

[h2]getIsAppAuthorized

Method

public Boolean getIsAppAuthorized()

Checks whether the file is created or opened by the requesting app.

Returns

Type

Description

Boolean

Whether the file is created or opened by the requesting app.

  • true: yes
  • false: no

[h2]setIsAppAuthorized

Method

public File setIsAppAuthorized(Boolean isAppAuthorized)

Sets whether the file is created or opened by the requesting app.

Parameters

Name

Description

isAppAuthorized

Indicates whether the file is created or opened by the requesting app.

  • true: yes
  • false: no

Returns

Type

Description

File

A File object.

[h2]getLastEditor

Method

public User getLastEditor()

Obtains information about the last user who modifies the file.

Returns

Type

Description

User

Information about the last user who modifies the file.

[h2]setLastEditor

Method

public File setLastEditor(User lastEditor)

Sets information about the last user who modifies the file.

Parameters

Name

Description

lastEditor

Information about the last user who modifies the file.

Returns

Type

Description

File

A File object.

[h2]getEditedByMe

Method

public Boolean getEditedByMe()

Checks whether the file is modified by the current user.

Returns

Type

Description

Boolean

Whether the file is modified by the current user.

  • true: yes
  • false: no

[h2]setEditedByMe

Method

public File setEditedByMe(Boolean editedByMe)

Sets whether the file is modified by the current user.

Parameters

Name

Description

editedByMe

Indicates whether the file is modified by the current user.

  • true: yes
  • false: no

Returns

Type

Description

File

A File object.

[h2]getEditedByMeTime

Method

public DateTime getEditedByMeTime()

Obtains the last time when the file is modified by the current user, in RFC 3339 date-time format.

Returns

Type

Description

DateTime

Last time when the file was modified by the current user, in RFC 3339 date-time format.

[h2]setEditedByMeTime

Method

public File setEditedByMeTime(DateTime editedByMeTime)

Sets the last time when the file is modified by the current user, in RFC 3339 date-time format.

Parameters

Name

Description

editedByMeTime

Last time when the file was modified by the current user, in RFC 3339 date-time format.

Returns

Type

Description

File

A File object.

[h2]getOwnedByMe

Method

public Boolean getOwnedByMe()

Checks whether the user owns the file.

Returns

Type

Description

Boolean

Whether the user owns the file.

[h2]setOwnedByMe

Method

public File setOwnedByMe(Boolean ownedByMe)

Sets whether the user owns the file.

Parameters

Name

Description

ownedByMe

Indicates whether the user owns the file.

Returns

Type

Description

File

A File object.

[h2]getPermissionIds

Method

public List<String> getPermissionIds()

Obtains the IDs of permissions for users to access the file.

Returns

Type

Description

List<String>

IDs of permissions for users to access the file.

[h2]setPermissionIds

Method

public File setPermissionIds(List<String> permissionIds)

Sets the IDs of permissions for users to access the file.

Parameters

Name

Description

permissionIds

IDs of permissions for users to access the file.

Returns

Type

Description

File

A File object.

[h2]getPermissions

Method

public List<Permission> getPermissions()

Obtains the list of all permissions for the file.

Returns

Type

Description

List<Permission>

List of permissions for the file.

[h2]setPermissions

Method

public File setPermissions(List<Permission> permissions)

Sets the list of all permissions for the file. Only the user who shares the file has the permissions, and users who access the file on the drive do not.

Parameters

Name

Description

permissions

All permissions for the file. Only the user who shares the file has the permissions, and users who access the file on the drive do not.

Returns

Type

Description

File

A File object.

[h2]getOccupiedSpace

Method

public Long getOccupiedSpace()

Obtains the storage space occupied by the file.

Returns

Type

Description

Long

Storage space occupied by the file.

[h2]setOccupiedSpace

Method

public File setOccupiedSpace(Long occupiedSpace)

Sets the storage space occupied by the file.

Parameters

Name

Description

occupiedSpace

Storage space occupied by the file.

Returns

Type

Description

File

A File object.

[h2]getSha256

Method

public String getSha256()

Obtains the SHA-256 value for verifying the file.

Returns

Type

Description

String

SHA-256 value for verifying the file.

[h2]setSha256

Method

public File setSha256(String sha256)

Sets the SHA-256 value for verifying the file.

Parameters

Name

Description

sha256

SHA-256 value for verifying the file. This parameter may not be set on the client. If it is set, the server will use the SHA-256 value for verifying the file.

Returns

Type

Description

File

A File object.

[h2]getHasShared

Method

public Boolean getHasShared()

Checks whether the file is shared.

Returns

Type

Description

Boolean

Whether the file is shared.

[h2]setHasShared

Method

public File setHasShared(Boolean hasShared)

Sets whether the file is shared.

Parameters

Name

Description

hasShared

Indicates whether the file is shared.

Returns

Type

Description

File

A File object.

[h2]getSharedWithMeTime

Method

public DateTime getSharedWithMeTime()

Obtains the time when the file is shared by a user, in RFC 3339 date-time format.

Returns

Type

Description

DateTime

Time when the file is shared by a user, in RFC 3339 date-time format.

[h2]setSharedWithMeTime

Method

public File setSharedWithMeTime(DateTime sharedWithMeTime)

Sets the time when the file is shared by a user, in RFC 3339 date-time format.

Parameters

Name

Description

sharedWithMeTime

Time when the file is shared by a user, in RFC 3339 date-time format.

Returns

Type

Description

File

A File object.

[h2]getSharer

Method

public User getSharer()

Obtains the user who shares the file.

Returns

Type

Description

User

User who shares the file.

[h2]setSharer

Method

public File setSharer(User sharer)

Sets the user who shares the file.

Parameters

Name

Description

sharer

User who shares the file.

Returns

Type

Description

File

A File object.

[h2]getContainers

Method

public List<String> getContainers()

Obtains the types of space that may contain the file.

Returns

Type

Description

List<String>

Types of space that may contain the file.

[h2]setContainers

Method

public File setContainers(List<String> containers)

Sets the types of space that may contain the file. The options include drive and applicationData.

Parameters

Name

Description

containers

Types of space that may contain the file. The options include drive and applicationData.

Returns

Type

Description

File

A File object.

[h2]getThumbnailDownloadLink

Method

public String getThumbnailDownloadLink()

Obtains the link to the thumbnail of the file.

Returns

Type

Description

String

Link to the thumbnail of the file. A 0-KB file does not have a thumbnail.

[h2]setThumbnailDownloadLink

Method

public File setThumbnailDownloadLink(String thumbnailDownloadLink)

Sets the link to the thumbnail of the file. The link is set only when the requesting app has the permission to access the file content.

Parameters

Name

Description

thumbnailDownloadLink

Link to the thumbnail of the file. The link is set only when the requesting app has the permission to access the file content.

Returns

Type

Description

File

A File object.

[h2]getSmallThumbnailDownloadLink

Method

public String getSmallThumbnailDownloadLink()

Obtains the link to the small thumbnail of the file.

Returns

Type

Description

String

Link to the small thumbnail of the file.

[h2]setSmallThumbnailDownloadLink

Method

public File setSmallThumbnailDownloadLink(String smallThumbnailDownloadLink)

Sets the link to the small thumbnail of the file. The link is set only when the requesting app has the permission to access the file content.

Parameters

Name

Description

smallThumbnailDownloadLink

Link to the small thumbnail of the file. The link is set only when the requesting app has the permission to access the file content.

Returns

Type

Description

File

A File object.

[h2]getRecycledTime

Method

public DateTime getRecycledTime()

Obtains the time when a file is moved to the recycle bin, in RFC 3339 date-time format.

Returns

Type

Description

DateTime

Time when a file is moved to the recycle bin, in RFC 3339 date-time format.

[h2]setRecycledTime

Method

public File setRecycledTime(DateTime recycledTime)

Sets the time when a file is moved to the recycle bin, in RFC 3339 date-time format.

Parameters

Name

Description

recycledTime

Time when a file is moved to the recycle bin, in RFC 3339 date-time format.

Returns

Type

Description

File

A File object.

[h2]getRecyclingUser

Method

public User getRecyclingUser()

Obtains the user who moves the file to the recycle bin.

Returns

Type

Description

User

User who moves the file to the recycle bin.

[h2]setRecyclingUser

Method

public File setRecyclingUser(User recyclingUser)

Sets the user who moves the file to the recycle bin.

Parameters

Name

Description

recyclingUser

User who moves the file to the recycle bin.

Returns

Type

Description

File

A File object.

[h2]getVideoMetadata

Method

public File.VideoMetadata getVideoMetadata()

Obtains additional video media metadata.

Returns

Type

Description

File.VideoMetadata

Additional video media metadata.

[h2]setVideoMetadata

Method

public File setVideoMetadata(File.VideoMetadata videoMetadata)

Sets additional video media metadata.

Parameters

Name

Description

videoMetadata

Additional video media metadata.

Returns

Type

Description

File

A File object.

[h2]getContentDownloadLink

Method

public String getContentDownloadLink()

Obtains the link for downloading the file in a browser.

Returns

Type

Description

String

Link for downloading the file in a browser.

[h2]setContentDownloadLink

Method

public File setContentDownloadLink(String contentDownloadLink)

Sets the link for downloading the file in a browser.

Parameters

Name

Description

contentDownloadLink

Link for downloading the file in a browser.

Returns

Type

Description

File

A File object.

[h2]getWritersHasSharePermission

Method

public Boolean getWritersHasSharePermission()

Checks whether a user who has only the write permission for the file can modify the file.

Returns

Type

Description

Boolean

Whether a user who has only the write permission for the file can modify the file.

[h2]setWritersHasSharePermission

Method

public File setWritersHasSharePermission(Boolean writersHasSharePermission)

Sets whether a user who has only the write permission for the file can modify the file.

Parameters

Name

Description

writersHasSharePermission

Whether a user who has only the write permission for the file can modify the file.

Returns

Type

Description

File

A File object.

[h2]getContentVersion

Method

public String getContentVersion()

Obtains the version number of the entity file content.

Returns

Type

Description

String

Version number of the entity file content.

[h2]setContentVersion

Method

public File setContentVersion(String contentVersion)

Sets the version number of the entity file content.

Parameters

Name

Description

contentVersion

Version number of the entity file content.

Returns

Type

Description

File

A File object.

[h2]getLastHistoryVersionId

Method

public String getLastHistoryVersionId()

Obtains the latest file version ID.

Returns

Type

Description

String

Latest file version ID.

[h2]setLastHistoryVersionId

Method

public File setLastHistoryVersionId(String lastHistoryVersionId)

Sets the latest file version ID.

Parameters

Name

Description

lastHistoryVersionId

Latest file version ID.

Returns

Type

Description

File

A File object.

[h2]getOriginalFilename

Method

public String getOriginalFilename()

Obtains the original file name.

Returns

Type

Description

String

Original file name.

[h2]setOriginalFilename

Method

public File setOriginalFilename(String originalFilename)

Sets the original file name.

Parameters

Name

Description

originalFilename

Original file name.

Returns

Type

Description

File

A File object.

[h2]getThumbnailVersion

Method

public Long getThumbnailVersion()

Obtains the thumbnail version number.

Returns

Type

Description

Long

Thumbnail version number.

[h2]setThumbnailVersion

Method

public File setThumbnailVersion(Long thumbnailVersion)

Sets the thumbnail version number.

Parameters

Name

Description

thumbnailVersion

Thumbnail version number.

Returns

Type

Description

File

A File object.

[h2]getVersion

Method

public Long getVersion()

Obtains the increasing version number of a file.

Returns

Type

Description

Long

Increasing version number of a file.

[h2]setVersion

Method

public File setVersion(Long version)

Sets the increasing version number of a file.

Parameters

Name

Description

version

Increasing version number of a file.

Returns

Type

Description

File

A File object.

[h2]getOnLineViewLink

Method

public String getOnLineViewLink()

Obtains the link to preview files online in a browser.

Returns

Type

Description

String

Link to preview files online in a browser.

[h2]setOnLineViewLink

Method

public File setOnLineViewLink(String onLineViewLink)

Sets the link to preview files online in a browser.

Parameters

Name

Description

onLineViewLink

Link to preview files online in a browser.

Returns

Type

Description

File

A File object.

[h2]set

Method

public File set(String fieldName, Object value)

Sets a custom attribute and its value.

Parameters

Name

Description

fieldName

Attribute name.

value

Attribute value.

Returns

Type

Description

File

A File object.

[h2]clone

Method

public File clone()

Clones a File object.

Returns

Type

Description

File

A File object.