Class DbxAppFilesRequests


  • public class DbxAppFilesRequests
    extends java.lang.Object
    Routes in namespace "files".
    • 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 be null.
        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 be null.
        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's ListFolderResult.getHasMore() field is true, call listFolderContinue(String) with the returned ListFolderResult.getCursor() to retrieve more entries.

        If you're using ListFolderArg.getRecursive() 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.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 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]+(/.*)?)" and not be null.
        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's ListFolderResult.getHasMore() field is true, call listFolderContinue(String) with the returned ListFolderResult.getCursor() to retrieve more entries. If you're using ListFolderArg.getRecursive() 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.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 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]+(/.*)?)" and not be null.
        Returns:
        Request builder for configuring request parameters and completing the request.
        Throws:
        java.lang.IllegalArgumentException - If any argument does not meet its preconditions.