Version 1.10 - Updated on 05/04/2017
public interface File extends ResourceItem
Stores file information.
String getMimeType()
String getChecksum()
String getCreationDate()
boolean isFavorite()
boolean isDeleted()
String getLocationStreet()
String getLocationLocality()
String getLocationCounty()
String getLocationCountry()
String getLocationRegion()
String getLocationPostalCode()
String getLocationCountryCode()
String getModificationDate()
int getPriority()
String getSource()
String getTags()
String getTimelineDate()
String getItemuid()
boolean delete(Context context, Boolean purge)
Deletes a folder or a file from user’s Persoanl Cloud Storage account at the path specified in the argument. This method makes an HTTP call and should not be called from the main thread. Throws Cloud API Exception with the error code USER_UNAUTHORIZED if the user is not authorized to perform this operation.
context
— Context objectpurge
— If set to true, deletes the file or folder. If not set, the default is false.File move(Context context, String target, Boolean safe, String conflictSolve)
Moves a file or a folder. If there is a missing folder in the target path, the folder is created. This method makes an HTTP call and should not be called from the main thread. Throws Cloud API Exception with the error code USER_UNAUTHAURIZED if the user is not authorized to perform this operation.
context
— Context objecttarget
— Cloud path where the folder or the file has to be moved to.safe
— If set to *true, ensures that name conflicts are resolved according to the value of the conflictsolve
parameter. Defaults to false, in which case the operation overwrites an existing file or folder of the same name. Set to null for default.conflictSolve
— Defines how name conflicts are resolved if the safe
parameter is set to true. If set to copy, a new file is written to the destination folder with a non-conflicting name. If not set, the operation is rolled back and returns 409 Conflict error message.File
object populated with file informationFile copy(Context context, String target, Boolean safe, String conflictSolve, String override)
Creates a copy of a file or folder. If there is a missing folder in the target path, creates a missing folder. This method makes an HTTP call and should not be called from the main thread. Throws Cloud API Exception with the error code USER_UNAUTHAURIZED if the user is not authorized to perform this operation.
context
— Context objecttarget
— Cloud path where the folder or the file has to be copied to.safe
— If set to *true, ensures that name conflicts are resolved according to the value of the conflictsolve
parameter. Defaults to false, in which case the operation overwrites an existing file or folder of the same name. Set to null for default.conflictSolve
— Defines how name conflicts are resolved if the safe
parameter is set to true. If set to copy, a new file is written to the destination folder with a non-conflicting name. If not set, the operation is rolled back and returns 409 Conflict error message.override
— Specifies what happens when a folder of the same name already exists at the specified path:File
object populated with file information.File rename(Context context, String target, Boolean safe, String conflictSolve)
Rename a fileor a folder stored under user’s cloud storage account. This method makes an HTTP call and should not be called from the main thread. Throws Cloud API Exception with the error code USER_UNAUTHAURIZED if the user is not authorized to perform this operation.
context
— Context objecttarget
— Full path of the target file or folder for copy, move, or rename operations. In case of files, the full or changed name should be included in the target.safe
— If set to *true, ensures that name conflicts are resolved according to the value of the conflictsolve
parameter. Defaults to false, in which case the operation overwrites an existing file or folder of the same name. Set to null for default.conflictSolve
— Defines how name conflicts are resolved if the safe
parameter is set to true. If set to copy, a new file is written to the destination folder with a non-conflicting name. If not set, the operation is rolled back and returns 409 Conflict error message.File
object populated with file information.boolean download(Context context, String downloadPath)
Downloads a file from user’s cloud storage account. File is downloaded at the downloadPath}
location. This method makes an HTTP call and should not be called from the main thread. Throws Cloud API Exception with the error code USER_UNAUTHAURIZED if the user is not authorized to perform this operation.
context
— Context objectdownloadPath
— Intended destination directory path.boolean getThumbnailToStream(Context context, OutputStream outputStream)
Downloads a thumbnail to the output stream. This method resizes the thumbnail to - 128X128. This method makes an HTTP call and should not be called from the main thread. Throws Cloud API Exception with the error code USER_UNAUTHAURIZED if the user is not authorized to perform this operation.
context
— Context objectoutputStream
— Output stream where thumbnail bytes are intended to be written.boolean getThumbnailToStream(Context context, OutputStream outputStream, int height, int width)
Downloads a resized thumbnail to the output stream. Thumbnail is resized to the height and width provided in the argument. This method makes an HTTP call and should not be called from the main thread. Throws Cloud API Exception with the error code USER_UNAUTHAURIZED if the user is not authorized to perform this operation.
context
— Context objectoutputStream
— Output stream where thumbnail bytes are to be written.height
— Intended height of resized thumbnail.width
— Intended width of resized thumbnail.boolean getThumbnailToStream(Context context, OutputStream outputStream, ThumbnailSize size)
Downloads a thumbnail to the output stream. This method resizes the thumbnail to the ThumbnailSize
provided in the argument. This method makes an HTTP call and should not be called from the main thread. Throws Cloud API Exception with the error code USER_UNAUTHAURIZED if the user is not authorized to perform this operation.
context
— Context objectoutputStream
— Output stream where thumbnail bytes are to be written.size
— Size of thumbnail to be downloaded as defined in ThumbnailSize
.Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.