public class CloudAPI
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CloudAPI.QueryType
Search query type
|
static class |
CloudAPI.Search
Search parameter names.
|
Constructor and Description |
---|
CloudAPI(java.lang.String appID,
java.lang.String appSecret,
java.lang.String callbackUrl)
Initialize a CloudAPI object to authenticate the user
and authorize the application to access user's cloud storage account.
|
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<java.lang.String> |
addToPlaylist(android.content.Context context,
java.lang.String playlistUid,
java.util.ArrayList<java.lang.String> paths)
Add item(s) to an existing playlist.
|
void |
authByToken(android.content.Context context,
java.lang.String token,
java.lang.String deviceId,
java.lang.String mdn,
AuthorizationCallback authorizationCallback) |
void |
authorize(android.content.Context context,
AuthorizationCallback authorizationCallback)
Authenticates the user and authorizes the application to access user's content through Personal Cloud Storage APIs.
|
ItemList<MetadataItem> |
copy(android.content.Context context,
java.lang.String src,
java.lang.String target,
java.lang.Boolean safe,
java.lang.String conflictSolve,
java.lang.String override)
Creates a copy of a file or folder.
|
MetadataItem |
createFolder(android.content.Context context,
java.lang.String path,
java.lang.String folderName,
java.lang.String override)
Creates a folder in user's cloud storage account at the path specified in the argument.
|
Playlist |
createPlaylist(android.content.Context context,
java.lang.String name,
java.util.ArrayList<java.lang.String> paths,
PlaylistType playlistType)
Creates a playlist, with or without items.
|
Share |
createShare(android.content.Context context,
java.lang.String name,
int expiresIn,
java.util.ArrayList<ShareResource> shareResources)
Create a share with file(s), folder(s) and playlist(s).
|
VirtualFolder |
createVirtualFolder(android.content.Context context,
java.lang.String name)
Create a new virtual folder in user's cloud storage account.
|
boolean |
delete(android.content.Context context,
java.lang.String path,
java.lang.Boolean purge)
Deletes a folder/file from user's cloud storage account at the path specified in the argument.
|
boolean |
deletePlaylist(android.content.Context context,
java.lang.String playlistUid)
Delete an existing playlist.
|
boolean |
deletePlaylistItem(android.content.Context context,
java.lang.String playlistUid,
java.lang.String itemUid)
Delete an existing playlist item.
|
boolean |
deleteShare(android.content.Context context,
java.lang.String shareUid)
Delete a share stored under user's cloud storage account.
|
boolean |
deleteTags(android.content.Context context,
java.lang.String uri)
Removes the tags for the file or folder at the specified path.
|
boolean |
deleteVirtualFolder(android.content.Context context,
java.lang.String name,
java.lang.Boolean force)
Delete a virtual folder from user's cloud storage account.
|
java.io.InputStream |
downloadFile(android.content.Context context,
java.lang.String parentPath,
java.lang.String name)
Downloads a file from user's cloud storage account.
|
boolean |
downloadFile(android.content.Context context,
java.lang.String parentPath,
java.lang.String name,
java.lang.String downloadPath)
Downloads a file from user's cloud storage account.
|
ItemList<FullviewItem> |
fullview(android.content.Context context)
Retrieve information about all the files stored under user's cloud storage account.
|
java.lang.String |
getAccessToken(android.content.Context context)
Retrieve the access token to use Cloud APIs.
|
AccountInformation |
getAccountInformation(android.content.Context context)
Retrieves account information of the Cloud storage.
|
ItemList<Artist> |
getArtists(android.content.Context context)
Retrieves a list of all Music artists stored under user's cloud storage account.
|
ItemList<Playlist> |
getAudioPlaylists(android.content.Context context,
SortType sortType)
Retrieves all audio playlists stored under user's cloud storage account.
|
ItemList<Audio> |
getAudios(android.content.Context context,
SortType sortType)
Retrieves a list of all Audio files stored under user's cloud storage account.
|
ItemList<Contact> |
getContacts(android.content.Context context)
Retrieve the contacts synced under user's cloud storage account.
|
ItemList<File> |
getDocuments(android.content.Context context,
SortType sortType)
Retrieve a list of all documents stored under user's cloud storage account.
|
ItemList<Genre> |
getGenres(android.content.Context context)
Retrieves a list of all Music genres stored under user's cloud storage account.
|
java.lang.String |
getLCID(android.content.Context context) |
ItemList<MetadataItem> |
getMetadata(android.content.Context context,
java.lang.String path)
Retrieves metadata information for the specified path.
|
ItemList<MetadataItem> |
getMetadata(android.content.Context context,
java.lang.String path,
SortType sortType,
int page,
int count,
java.lang.String filter,
java.lang.Boolean includeDeleted)
Retrieves metadata information for the specified path.
|
ItemList<Album> |
getMusicAlbums(android.content.Context context,
SortType sortType)
Retrieves a list of all Music albums stored under user's cloud storage account.
|
ItemList<Album> |
getPhotoAlbums(android.content.Context context,
SortType sortType)
Retrieves all Photo albums stored under user's cloud storage account.
|
ItemList<Photo> |
getPhotos(android.content.Context context,
SortType sortType)
Retrieves a list of all image files stored under user's cloud storage account.
|
ItemList<PlaylistItem> |
getPlaylistItems(android.content.Context context,
java.lang.String playlistUid,
SortType sortType,
int page,
int count)
Retrieves the details of all items contained in a playlist.
|
ItemList<Playlist> |
getPlaylists(android.content.Context context,
PlaylistType playlistType,
SortType sortType,
int page,
int count)
Retrieves all playlists stored under user's cloud storage account.
|
ItemList<Share> |
getShares(android.content.Context context,
java.lang.String since,
java.lang.String until)
Retrieves a list of all shares stored under user's cloud storage account.
|
java.lang.String |
getTags(android.content.Context context,
java.lang.String path)
Retrieve the tags stored in the cloud for the file or folder under the specified path.
|
boolean |
getThumbnailToStream(android.content.Context context,
java.lang.String contentToken,
java.io.OutputStream outputStream)
Downloads a thumbnail to the output stream.
|
boolean |
getThumbnailToStream(android.content.Context context,
java.lang.String contentToken,
java.io.OutputStream outputStream,
int height,
int width)
Downloads a resized thumbnail to the output stream.
|
boolean |
getThumbnailToStream(android.content.Context context,
java.lang.String contentToken,
java.io.OutputStream outputStream,
ThumbnailSize size)
Downloads a thumbnail to the output stream.
|
ItemList<MetadataItem> |
getTrash(android.content.Context context,
SortType sortType,
int page,
int count,
java.lang.String filter,
java.lang.Boolean deep)
Retrieves a list of files and folders that have been deleted from a user's Personal Cloud Storage.
|
ItemList<Video> |
getVideos(android.content.Context context,
SortType sortType)
Retrieves a list of all video files stored under user's cloud storage account.
|
boolean |
hasAuthorization(android.content.Context context)
Verify if user is authenticated and application is authorized to access user's content.
|
void |
logout(android.content.Context context)
Logs out the user by clearing the token and cache.
|
ItemList<MetadataItem> |
move(android.content.Context context,
java.lang.String src,
java.lang.String target,
java.lang.Boolean safe,
java.lang.String conflictSolve)
Move a file or a folder.
|
boolean |
purgeTrash(android.content.Context context)
Purges all the files and folder that are in a deleted state in user's Personal Cloud Storage.
|
ItemList<MetadataItem> |
rename(android.content.Context context,
java.lang.String src,
java.lang.String target,
java.lang.Boolean safe,
java.lang.String conflictSolve)
Rename a file/folder stored under user's cloud storage account.
|
VirtualFolder |
renameVirtualFolder(android.content.Context context,
java.lang.String src,
java.lang.String target)
Rename a virtual folder in user's cloud storage account.
|
boolean |
restoreTrash(android.content.Context context,
java.util.ArrayList<java.lang.String> paths)
Restores files/folders from trash to their original location.
|
void |
search(android.content.Context context,
CloudAPI.QueryType queryType,
java.lang.String query,
java.lang.String groupBy,
java.lang.String sortBy,
int limit,
SearchCallback searchCallback)
Search for file(s) and folder(s) stored under user's cloud storage account.
|
void |
setLogLevel(LogLevel logLevel)
Set the log level for the SDK.
|
java.lang.String |
setTags(android.content.Context context,
java.lang.String uri,
java.lang.String tags)
Updates the tags for the file or folder at the specified path.
|
Playlist |
updatePlaylist(android.content.Context context,
java.lang.String uid,
java.lang.String name)
Updates a playlist's name.
|
Playlist |
updatePlaylistDefinition(android.content.Context context,
java.lang.String playlistUid,
java.lang.String name,
PlaylistType playlistType,
java.util.ArrayList<java.lang.String> paths)
Updates a playlist definition with new playlist definition.
|
boolean |
uploadFile(android.content.Context context,
java.lang.String uploadPath,
java.lang.String fileName,
java.lang.String filePath)
Upload a file to user's cloud storage account.
|
public CloudAPI(java.lang.String appID, java.lang.String appSecret, java.lang.String callbackUrl)
authorize(Context, AuthorizationCallback)
to start authorization.appID
- Application ID that was provisioned by the ThingSpace portalappSecret
- Application Secret that was provisioned by the ThingSpace portalcallbackUrl
- Callback Url that was provisioned to ThingSpace portal to return auth code.public void authorize(android.content.Context context, AuthorizationCallback authorizationCallback)
context
- the Context
- to launch the CloudAPI authorization activity.
This will typically be an Activity
and the user will be taken back to that
activity after authorization is complete (i.e. the activity will receive an onResume()
).authorizationCallback
- AuthorizationCallback
to receive success or error response.public void authByToken(android.content.Context context, java.lang.String token, java.lang.String deviceId, java.lang.String mdn, AuthorizationCallback authorizationCallback)
public java.lang.String getAccessToken(android.content.Context context)
public void logout(android.content.Context context)
context
- Context
objectpublic boolean hasAuthorization(android.content.Context context)
authorize(Context, AuthorizationCallback)
to begin authorization.public ItemList<MetadataItem> getMetadata(android.content.Context context, java.lang.String path)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectpath
- Path of a folder or file stored in user's cloud storage account.ItemList
populated with the MetadataItem
as a list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<MetadataItem> getMetadata(android.content.Context context, java.lang.String path, SortType sortType, int page, int count, java.lang.String filter, java.lang.Boolean includeDeleted)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectpath
- Path of a folder or file stored in user's cloud storage account.sortType
- The sort type as defined in SortType
, combined with sort order SortType.setOrder(SortType.SortOrder)
.
page
- Page number for the paginated response. If page is set to 2 and count is 50, items number 51 to 100 will be returned.count
- Maximum items to include in a paginated response. Default is 20. filter
- Set to file to retrieve only files. Set to Folder to retrieve only folders. Set null to retrieve both.
includeDeleted
- If true, response includes the metadata for deleted files and folders. Default is false.ItemList
populated with the MetadataItem
as a list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<MetadataItem> getTrash(android.content.Context context, SortType sortType, int page, int count, java.lang.String filter, java.lang.Boolean deep)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectsortType
- The sort type as defined in SortType
, combined with sort order SortType.setOrder(SortType.SortOrder)
.
page
- Page number for the paginated response. If page is set to 2 and count is 50, items number 51 to 100 will be returned.count
- Maximum items to include in a paginated response. Default is 20. filter
- Set to file to retrieve only files. Set to folder to retrieve only folders. Set null to retrieve both.
deep
- If true, response includes the trash data of sub-folders. Default is false.ItemList
populated with the MetadataItem
as a list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public boolean restoreTrash(android.content.Context context, java.util.ArrayList<java.lang.String> paths)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectpaths
- Array list of file/folder paths to be restored. Path for a file/folder can be obtained as: ResourceItem.getParentPath()
+ "/" ResourceItem.getName()
CloudAPIException
will be thrown if the request cannot be processed.public boolean purgeTrash(android.content.Context context)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectCloudAPIException
will be thrown if the request cannot be processed.public AccountInformation getAccountInformation(android.content.Context context)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectAccountInformation
- data containing available and used storage. CloudAPIException
will be thrown if the request cannot be processed.public boolean downloadFile(android.content.Context context, java.lang.String parentPath, java.lang.String name, java.lang.String downloadPath)
downloadPath
location.
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectparentPath
- Path of the directory where the file is stored.name
- File name.downloadPath
- Intended destination directory path.CloudAPIException
will be thrown if the request cannot be processed.public java.io.InputStream downloadFile(android.content.Context context, java.lang.String parentPath, java.lang.String name)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectparentPath
- Path of the directory where the file is stored.name
- File name.CloudAPIException
will be thrown if the request cannot be processed.public boolean uploadFile(android.content.Context context, java.lang.String uploadPath, java.lang.String fileName, java.lang.String filePath)
uploadPath
location.
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectuploadPath
- Path of the directory where the file is intended to be stored on the cloud.fileName
- File name.filePath
- Path of the directory where the file is stored on the device.CloudAPIException
will be thrown if the request cannot be processed.public boolean getThumbnailToStream(android.content.Context context, java.lang.String contentToken, java.io.OutputStream outputStream)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectcontentToken
- File Content Token as retrieved from ResourceItem.getContentToken()
.outputStream
- output stream where thumbnail bytes are intended to be written.CloudAPIException
will be thrown if the request cannot be processed.public boolean getThumbnailToStream(android.content.Context context, java.lang.String contentToken, java.io.OutputStream outputStream, int height, int width)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectcontentToken
- File Content Token as retrieved from ResourceItem.getContentToken()
.outputStream
- output stream where thumbnail bytes are intended to be written.height
- Intended height of resized thumbnail.width
- Intended width of resized thumbnail.CloudAPIException
will be thrown if the request cannot be processed.public boolean getThumbnailToStream(android.content.Context context, java.lang.String contentToken, java.io.OutputStream outputStream, ThumbnailSize size)
ThumbnailSize
provided in the argument.
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectcontentToken
- Content-Token of file of which the thumbnail has to be downloaded.outputStream
- output stream where thumbnail bytes are intended to be written.size
- Size of thumbnail to be downloaded as defined in ThumbnailSize
.
CloudAPIException
will be thrown if the request cannot be processed.public void search(android.content.Context context, CloudAPI.QueryType queryType, java.lang.String query, java.lang.String groupBy, java.lang.String sortBy, int limit, SearchCallback searchCallback)
context
- Context
objectqueryType
- CloudAPI.QueryType
- type of the search query. It could be either CloudAPI.QueryType.SQL
or CloudAPI.QueryType.LUCENE
query
- the search query to be executed. If queryType
is QueryType.SQL, query must follow SQL query standards. If queryType
is QueryType.Lucene, query must be a valid Lucene search query.groupBy
- groupBy specifies the filter to group the result list items. Passing null will cause the list items to not be grouped. Use CloudAPI.Search
parameters.sortBy
- sortBy specifies the sort criteria for the result list.limit
- Limits the number of item in the result list.searchCallback
- SearchCallback
to receive the search result or an error.public ItemList<FullviewItem> fullview(android.content.Context context)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectItemList
populated with the FullviewItem
as a list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<Contact> getContacts(android.content.Context context)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectItemList
populated with the Contact
as a list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<Playlist> getPlaylists(android.content.Context context, PlaylistType playlistType, SortType sortType, int page, int count)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
object
playlistType
- the type of playlist as defined in PlaylistType
.sortType
- The sort type as defined in SortType
, combined with sort order SortType.setOrder(SortType.SortOrder)
. Supported sort specifications for playlist are, SortType.NAME
, SortType.CREATION_DATE
, SortType.VERSION_CREATED
, SortType.MODIFICATION_DATE
.
page
- Page number for the paginated response. If page is set to 2 and count is 50, playlist number 51 to 100 will be returned.count
- Maximum items to include in a paginated response. Default is 20. ItemList
populated with the Playlist
as a list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<PlaylistItem> getPlaylistItems(android.content.Context context, java.lang.String playlistUid, SortType sortType, int page, int count)
context
- Context
object
playlistUid
- Unique ID assigned to the playlist. Accessible by Playlist.getUid()
.
sortType
- The sort type as defined in SortType
, combined with sort order SortType.setOrder(SortType.SortOrder)
.
page
- Page number for the paginated response. If page is set to 2 and count is 50, items number 51 to 100 will be returned.count
- Maximum items to include in a paginated response. Default is 20. ItemList
populated with the PlaylistItem
as a list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public Playlist createPlaylist(android.content.Context context, java.lang.String name, java.util.ArrayList<java.lang.String> paths, PlaylistType playlistType)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectname
- name of the playlist.paths
- array of files path to be included in this playlist. Pass null to create an empty playlist.playlistType
- type of playlist as defined in PlaylistType
.
Playlist
object. CloudAPIException
will be thrown if the request cannot be processed.public Playlist updatePlaylist(android.content.Context context, java.lang.String uid, java.lang.String name)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectuid
- playlist unique identifier - can be obtained at Playlist.getUid()
name
- Intended name of the playlist.Playlist
object populated with new playlist information. CloudAPIException
will be thrown if the request cannot be processed.public Playlist updatePlaylistDefinition(android.content.Context context, java.lang.String playlistUid, java.lang.String name, PlaylistType playlistType, java.util.ArrayList<java.lang.String> paths)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectplaylistUid
- playlist unique identifier - can be obtained at Playlist.getUid()
name
- Intended name of the playlist.playlistType
- Type of the playlist as defined in PlaylistType
.paths
- ArrayList of files path to be included in the new definition for this playlist. Passing null will empty the playlist.Playlist
object populated with new playlist information. CloudAPIException
will be thrown if the request cannot be processed.public java.util.ArrayList<java.lang.String> addToPlaylist(android.content.Context context, java.lang.String playlistUid, java.util.ArrayList<java.lang.String> paths)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectplaylistUid
- Playlist unique identifier - can be obtained at Playlist.getUid()
.paths
- ArrayList of Files paths to be added to this playlist.public boolean deletePlaylist(android.content.Context context, java.lang.String playlistUid)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectplaylistUid
- playlist unique identifier - can be obtained at Playlist.getUid()
.public boolean deletePlaylistItem(android.content.Context context, java.lang.String playlistUid, java.lang.String itemUid)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectplaylistUid
- playlist unique identifier - can be obtained at Playlist.getUid()
.itemUid
- playlist item unique identifier - can be obtained at PlaylistItem.getItemuid()
..public MetadataItem createFolder(android.content.Context context, java.lang.String path, java.lang.String folderName, java.lang.String override)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
object
path
- Cloud path where the folder has to be created.
folderName
- Name of the folder to be created.
override
- Specifies what happens when a folder of the same name already exists at the specified path:MetadataItem
- object of folder from the path, null otherwise. CloudAPIException
will be thrown if the request cannot be processed.public boolean delete(android.content.Context context, java.lang.String path, java.lang.Boolean purge)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectpath
- Cloud path where the folder/file has to be deleted.purge
- If set to true, file or folder will be deleted permanently and will not be moved to trash. Default is false.CloudAPIException
will be thrown if the request cannot be processed.public ItemList<MetadataItem> move(android.content.Context context, java.lang.String src, java.lang.String target, java.lang.Boolean safe, java.lang.String conflictSolve)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectsrc
- Cloud path where the folder/file has to be moved from.target
- Cloud path where the folder/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 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.ItemList
- list of files and folders from the target path, populated with the MetadataItem
as a list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<MetadataItem> copy(android.content.Context context, java.lang.String src, java.lang.String target, java.lang.Boolean safe, java.lang.String conflictSolve, java.lang.String override)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
object
src
- Cloud path where the folder/file has to be copied from.
target
- Cloud path where the folder/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 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:ItemList
- list of files and folders from the target path, populated with the MetadataItem
as a list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<MetadataItem> rename(android.content.Context context, java.lang.String src, java.lang.String target, java.lang.Boolean safe, java.lang.String conflictSolve)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectsrc
- Full path of the file or folder for copy, move, or rename operations.target
- 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 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.ItemList
- list of files and folders from the target path, populated with the MetadataItem
as a list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<Photo> getPhotos(android.content.Context context, SortType sortType)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectsortType
- The sort type as defined in SortType
, combined with sort order SortType.setOrder(SortType.SortOrder)
.
SortType.CAPTURE_DATE
, SortType.NAME
, SortType.SIZE
, SortType.HEIGHT
, SortType.WIDTH
, SortType.MODIFICATION_DATE
, SortType.CREATION_DATE
, SortType.TIMELINE_DATE
, SortType.EXTENSION
, SortType.TAGS
, SortType.TITLE
, SortType.VERSION_CREATED
, SortType.FAVORITE
, SortType.SOURCE
.
Pass null for default order.ItemList
populated with Photo
as list item. This list will contain the files that has image mime-type stored under user's cloud storage account. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<Audio> getAudios(android.content.Context context, SortType sortType)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectsortType
- The sort type as defined in SortType
, combined with sort order SortType.setOrder(SortType.SortOrder)
.
SortType.ALBUM
, SortType.NAME
, SortType.SIZE
, SortType.ARTIST
, SortType.GENRE
, SortType.COMPILATION
, SortType.MODIFICATION_DATE
, SortType.CREATION_DATE
, SortType.TIMELINE_DATE
, SortType.EXTENSION
, SortType.TAGS
, SortType.TITLE
, SortType.VERSION_CREATED
, SortType.FAVORITE
, SortType.SOURCE
.
Pass null for default order.ItemList
populated with Audio
as list item. This list will contain the files that has audio mime-type stored under user's cloud storage account. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<Video> getVideos(android.content.Context context, SortType sortType)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectsortType
- The sort type as defined in SortType
, combined with sort order SortType.setOrder(SortType.SortOrder)
.
SortType.CAPTURE_DATE
, SortType.NAME
, SortType.SIZE
, SortType.ARTIST
, SortType.ALBUM
, SortType.MODIFICATION_DATE
, SortType.CREATION_DATE
, SortType.TIMELINE_DATE
, SortType.EXTENSION
, SortType.TAGS
, SortType.TITLE
, SortType.VERSION_CREATED
, SortType.FAVORITE
, SortType.SOURCE
.
Pass null for default order.ItemList
populated with Video
as list item. This list will contain the files that has video mime-type stored under user's cloud storage account. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<File> getDocuments(android.content.Context context, SortType sortType)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectsortType
- The sort type as defined in SortType
, combined with sort order SortType.setOrder(SortType.SortOrder)
.
SortType.NAME
, SortType.SIZE
, SortType.MODIFICATION_DATE
, SortType.CREATION_DATE
, SortType.TIMELINE_DATE
, SortType.EXTENSION
, SortType.TAGS
, SortType.TITLE
, SortType.VERSION_CREATED
, SortType.FAVORITE
, SortType.SOURCE
.
Pass null for default order.ItemList
populated with File
as list item. This list will contain all the documents stored under user's cloud storage account. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<Album> getPhotoAlbums(android.content.Context context, SortType sortType)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectsortType
- The sort type as defined in SortType
, combined with sort order SortType.setOrder(SortType.SortOrder)
. Supported sort specifications for Photo Albums are, SortType.NAME
, SortType.CREATION_DATE
, SortType.VERSION_CREATED
, SortType.MODIFICATION_DATE
.
SortType.NAME
, SortType.MODIFICATION_DATE
, SortType.CREATION_DATE
.
Pass null for default order.ItemList
populated with the Album
as a list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<Playlist> getAudioPlaylists(android.content.Context context, SortType sortType)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectsortType
- The sort type as defined in SortType
, combined with sort order SortType.setOrder(SortType.SortOrder)
. Supported sort specifications for playlist are, SortType.NAME
, SortType.CREATION_DATE
, SortType.VERSION_CREATED
, SortType.MODIFICATION_DATE
.
SortType.NAME
, SortType.MODIFICATION_DATE
, SortType.CREATION_DATE
.
Pass null for default order.ItemList
populated with the Playlist
as a list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<Album> getMusicAlbums(android.content.Context context, SortType sortType)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectsortType
- The sort type as defined in SortType
, combined with sort order SortType.setOrder(SortType.SortOrder)
.
SortType.ALBUM
.
Pass null for default order.ItemList
populated with Album
as list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<Genre> getGenres(android.content.Context context)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectItemList
populated with Genre
as list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<Artist> getArtists(android.content.Context context)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectItemList
populated with Artist
as list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public ItemList<Share> getShares(android.content.Context context, java.lang.String since, java.lang.String until)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectsince
- The date and time, expressed in the W3C date and time format, after which messages are to be returned. Pass null to retrieve all.until
- The date and time, expressed in the W3C date and time format, until which messages are to be returned. Pass null to retrieve all.ItemList
populated with Share
as list item. Call ItemList.close()
when the list is no longer needed. CloudAPIException
will be thrown if the request cannot be processed.public boolean deleteShare(android.content.Context context, java.lang.String shareUid)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectshareUid
- Unique ID that identifies a share. Can be obtained at Share.getUid()
.CloudAPIException
will be thrown if the request cannot be processed.public Share createShare(android.content.Context context, java.lang.String name, int expiresIn, java.util.ArrayList<ShareResource> shareResources)
fullview(Context)
, getPhotos(Context, SortType)
, getAudios(Context, SortType)
, getVideos(Context, SortType)
, getDocuments(Context, SortType)
getMetadata(Context, String)
, getMetadata(Context, String, SortType, int, int, String, Boolean)
, getPlaylists(Context, PlaylistType, SortType, int, int)
, getPhotoAlbums(Context, SortType)
or getAudioPlaylists(Context, SortType)
.
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectname
- The intended name of the share to be created.expiresIn
- The intended life time of the share in seconds. The value 0 signifies the share will never expire. Minimum value is 300.shareResources
- The array list of ShareResource
- the resources to be added to the share.Share
- populated with newly created share information if the share was created successfully. CloudAPIException
will be thrown if the request cannot be processed.public java.lang.String getTags(android.content.Context context, java.lang.String path)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectpath
- The path to the file or folder for which tags are to be retrieved. Path can be created by combining parentPath + "/" + fileName. Parent path and file names can be found in classes Photo
, Video
, Audio
, File
, FullviewItem
, MetadataItem
.CloudAPIException
will be thrown if the request cannot be processed.public java.lang.String setTags(android.content.Context context, java.lang.String uri, java.lang.String tags)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objecturi
- The uri to the file or folder for which tags are to be updated. Uri can be retrieved using ResourceItem.getUri()
, ResourceItem.getUri()
, ResourceItem.getUri()
, ResourceItem.getUri()
, ResourceItem.getUri()
, ResourceItem.getUri()
.tags
- Tags to be updated to this file or folder.CloudAPIException
will be thrown if the request cannot be processed.public boolean deleteTags(android.content.Context context, java.lang.String uri)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objecturi
- The uri to the file or folder for which tags are to be removed. Uri can be retrieved using ResourceItem.getUri()
, ResourceItem.getUri()
, ResourceItem.getUri()
, ResourceItem.getUri()
, ResourceItem.getUri()
, ResourceItem.getUri()
.CloudAPIException
will be thrown if the request cannot be processed.public java.lang.String getLCID(android.content.Context context)
public VirtualFolder createVirtualFolder(android.content.Context context, java.lang.String name)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectname
- name of the virtual folder to be createdVirtualFolder
object with the newly created virtual folder information. CloudAPIException
will be thrown if the request cannot be processed.public VirtualFolder renameVirtualFolder(android.content.Context context, java.lang.String src, java.lang.String target)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectsrc
- name of the virtual folder to be renamedtarget
- new name for the virtual folderVirtualFolder
object with the newly created virtual folder information. CloudAPIException
will be thrown if the request cannot be processed.public boolean deleteVirtualFolder(android.content.Context context, java.lang.String name, java.lang.Boolean force)
CloudAPIException
will be thrown with an error code CloudAPIException.ErrorCode#USER_UNAUTHORIZED
if user is not authorized to perform this operation.context
- Context
objectname
- name of the virtual folder to be deletedforce
- If 'false', does not delete if the virtual folder has any active or deleted file/folder(s). If 'true', deletes the virtual folder if it has references to only deleted file/folder(s). Defaults to false.CloudAPIException
will be thrown if the request cannot be processed.public void setLogLevel(LogLevel logLevel)
LogLevel.DEBUG
- prints more logs for debugging or LogLevel.ERROR
- prints only errors. Default is Error.logLevel
- LogLevel
- to set the log level