Class DbxAppFilesRequests
- java.lang.Object
-
- com.dropbox.core.v2.files.DbxAppFilesRequests
-
public class DbxAppFilesRequests extends java.lang.Object
Routes in namespace "files".
-
-
Constructor Summary
Constructors Constructor Description DbxAppFilesRequests(DbxRawClientV2 client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DbxDownloader<PreviewResult>
getThumbnailV2(PathOrLink resource)
Get a thumbnail for an image.DbxAppGetThumbnailV2Builder
getThumbnailV2Builder(PathOrLink resource)
Get a thumbnail for an image.ListFolderResult
listFolder(java.lang.String path)
Starts returning the contents of a folder.DbxAppListFolderBuilder
listFolderBuilder(java.lang.String path)
Starts returning the contents of a folder.ListFolderResult
listFolderContinue(java.lang.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 Detail
-
DbxAppFilesRequests
public DbxAppFilesRequests(DbxRawClientV2 client)
-
-
Method Detail
-
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
DbxAppGetThumbnailV2Builder
for 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:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.ThumbnailV2ErrorException
DbxException
-
getThumbnailV2Builder
public DbxAppGetThumbnailV2Builder getThumbnailV2Builder(PathOrLink resource)
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:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.
-
listFolder
public ListFolderResult listFolder(java.lang.String path) throws ListFolderErrorException, DbxException
Starts returning the contents of a folder. If the result'sListFolderResult.getHasMore()
field istrue
, calllistFolderContinue(String)
with the returnedListFolderResult.getCursor()
to retrieve more entries.If you're using
ListFolderArg.getRecursive()
set totrue
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'sFolderSharingInfo.getReadOnly()
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:
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
DbxAppListFolderBuilder
for more details.- Parameters:
path
- A unique identifier for the file. Must match pattern "(/(.|[\\r\\n])*)?|id:.*|(ns:[0-9]+(/.*)?)
" and not benull
.- Throws:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.ListFolderErrorException
DbxException
-
listFolderBuilder
public DbxAppListFolderBuilder listFolderBuilder(java.lang.String path)
Starts returning the contents of a folder. If the result'sListFolderResult.getHasMore()
field istrue
, calllistFolderContinue(String)
with the returnedListFolderResult.getCursor()
to retrieve more entries. If you're usingListFolderArg.getRecursive()
set totrue
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 eachFileMetadata
, 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 eachFolderMetadata
, 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'sFolderSharingInfo.getReadOnly()
and set all its children's read-only statuses to match. For eachDeletedMetadata
, 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: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]+(/.*)?)
" and not benull
.- Returns:
- Request builder for configuring request parameters and completing the request.
- Throws:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.
-
listFolderContinue
public ListFolderResult listFolderContinue(java.lang.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:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.ListFolderContinueErrorException
DbxException
-
-