Class DbxAppFilesRequests

java.lang.Object
com.dropbox.core.v2.files.DbxAppFilesRequests

public class DbxAppFilesRequests extends Object
Routes in namespace "files".
  • Constructor Details

    • DbxAppFilesRequests

      public DbxAppFilesRequests(DbxRawClientV2 client)
  • Method Details

    • getThumbnailV2

      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 be null.
      Returns:
      Downloader used to download the response body and view the server response.
      Throws:
      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 be null.
      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's ListFolderResult.getHasMore() field is true, call listFolderContinue(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 multiple listFolder(String) or listFolderContinue(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]+(/(.|[\\r\\n])*)?)" and not be null.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
      ListFolderErrorException
      DbxException
    • listFolderBuilder

      public DbxAppListFolderBuilder listFolderBuilder(String path)
      Starts returning the contents of a folder. If the result's ListFolderResult.getHasMore() field is true, call listFolderContinue(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 multiple listFolder(String) or listFolderContinue(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 be null.
      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 from listFolder(String), use this to paginate through all files and retrieve updates to the folder, following the same rules as documented for listFolder(String).
      Parameters:
      cursor - The cursor returned by your last call to listFolder(String) or listFolderContinue(String). Must have length of at least 1 and not be null.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
      ListFolderContinueErrorException
      DbxException