Package com.dropbox.core.v2.files
Class DbxAppFilesRequests
java.lang.Object
com.dropbox.core.v2.files.DbxAppFilesRequests
Routes in namespace "files".
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetThumbnailV2(PathOrLink resource) Get a thumbnail for an image.getThumbnailV2Builder(PathOrLink resource) Get a thumbnail for an image.listFolder(String path) Starts returning the contents of a folder.listFolderBuilder(String path) Starts returning the contents of a folder.listFolderContinue(String cursor) Once a cursor has been retrieved fromlistFolder(String), use this to paginate through all files and retrieve updates to the folder, following the same rules as documented forlistFolder(String).
-
Constructor Details
-
DbxAppFilesRequests
-
-
Method Details
-
getThumbnailV2
public DbxDownloader<PreviewResult> getThumbnailV2(PathOrLink resource) throws ThumbnailV2ErrorException, DbxException Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to a thumbnail.The default values for the optional request parameters will be used. See
DbxAppGetThumbnailV2Builderfor more details.- Parameters:
resource- Information specifying which file to preview. This could be a path to a file, a shared link pointing to a file, or a shared link pointing to a folder, with a relative path. Must not benull.- Returns:
- Downloader used to download the response body and view the server response.
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.ThumbnailV2ErrorExceptionDbxException
-
getThumbnailV2Builder
Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to a thumbnail.- Parameters:
resource- Information specifying which file to preview. This could be a path to a file, a shared link pointing to a file, or a shared link pointing to a folder, with a relative path. Must not benull.- Returns:
- Downloader builder for configuring the request parameters and instantiating a downloader.
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
listFolder
Starts returning the contents of a folder. If the result'sListFolderResult.getHasMore()field is true, calllistFolderContinue(String)with the returned ListFolderResult.cursor to retrieve more entries. If you're using ListFolderArg.recursive set to true to keep a local cache of the contents of a Dropbox account, iterate through each entry in order and process them as follows to keep your local state in sync: For each FileMetadata, store the new entry at the given path in your local state. If the required parent folders don't exist yet, create them. If there's already something else at the given path, replace it and remove all its children. For each FolderMetadata, store the new entry at the given path in your local state. If the required parent folders don't exist yet, create them. If there's already something else at the given path, replace it but leave the children as they are. Check the new entry's FolderSharingInfo.read_only and set all its children's read-only statuses to match. For each DeletedMetadata, if your local state has something at the given path, remove it and all its children. If there's nothing at the given path, ignore this entry. Note: auth.RateLimitError may be returned if multiplelistFolder(String)orlistFolderContinue(String)calls with same parameters are made simultaneously by same API app for same user. If your app implements retry logic, please hold off the retry until the previous request finishes.The default values for the optional request parameters will be used. See
DbxAppListFolderBuilderfor more details.- Parameters:
path- A unique identifier for the file. Must match pattern "(/(.|[\\r\\n])*)?|id:.*|(ns:[0-9]+(/(.|[\\r\\n])*)?)" and not benull.- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.ListFolderErrorExceptionDbxException
-
listFolderBuilder
Starts returning the contents of a folder. If the result'sListFolderResult.getHasMore()field is true, calllistFolderContinue(String)with the returned ListFolderResult.cursor to retrieve more entries. If you're using ListFolderArg.recursive set to true to keep a local cache of the contents of a Dropbox account, iterate through each entry in order and process them as follows to keep your local state in sync: For each FileMetadata, store the new entry at the given path in your local state. If the required parent folders don't exist yet, create them. If there's already something else at the given path, replace it and remove all its children. For each FolderMetadata, store the new entry at the given path in your local state. If the required parent folders don't exist yet, create them. If there's already something else at the given path, replace it but leave the children as they are. Check the new entry's FolderSharingInfo.read_only and set all its children's read-only statuses to match. For each DeletedMetadata, if your local state has something at the given path, remove it and all its children. If there's nothing at the given path, ignore this entry. Note: auth.RateLimitError may be returned if multiplelistFolder(String)orlistFolderContinue(String)calls with same parameters are made simultaneously by same API app for same user. If your app implements retry logic, please hold off the retry until the previous request finishes.- Parameters:
path- A unique identifier for the file. Must match pattern "(/(.|[\\r\\n])*)?|id:.*|(ns:[0-9]+(/(.|[\\r\\n])*)?)" and not benull.- Returns:
- Request builder for configuring request parameters and completing the request.
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
listFolderContinue
public ListFolderResult listFolderContinue(String cursor) throws ListFolderContinueErrorException, DbxException Once a cursor has been retrieved fromlistFolder(String), use this to paginate through all files and retrieve updates to the folder, following the same rules as documented forlistFolder(String).- Parameters:
cursor- The cursor returned by your last call tolistFolder(String)orlistFolderContinue(String). Must have length of at least 1 and not benull.- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.ListFolderContinueErrorExceptionDbxException
-