/** * Download a file from a user's Dropbox. * * @param _headers Extra headers to send with request. * * @return Downloader used to download the response body and view the server * response. */ DbxDownloader<FileMetadata> download(DownloadArg arg, List<HttpRequestor.Header> _headers) throws DownloadErrorException, DbxException { try { return this.client.downloadStyle(this.client.getHost().getContent(), "2/files/download", arg, false, _headers, DownloadArg.Serializer.INSTANCE, FileMetadata.Serializer.INSTANCE, DownloadError.Serializer.INSTANCE); } catch (DbxWrappedException ex) { throw new DownloadErrorException("2/files/download", ex.getRequestId(), ex.getUserMessage(), (DownloadError) ex.getErrorValue()); } }
/** * Exports and downloads Paper doc either as HTML or markdown. * * @param _headers Extra headers to send with request. * * @return Downloader used to download the response body and view the server * response. */ DbxDownloader<PaperDocExportResult> docsDownload(PaperDocExport arg, List<HttpRequestor.Header> _headers) throws DocLookupErrorException, DbxException { try { return this.client.downloadStyle(this.client.getHost().getApi(), "2/paper/docs/download", arg, false, _headers, PaperDocExport.Serializer.INSTANCE, PaperDocExportResult.Serializer.INSTANCE, DocLookupError.Serializer.INSTANCE); } catch (DbxWrappedException ex) { throw new DocLookupErrorException("2/paper/docs/download", ex.getRequestId(), ex.getUserMessage(), (DocLookupError) ex.getErrorValue()); } }
/** * Download the shared link's file from a user's Dropbox. * * @param _headers Extra headers to send with request. * * @return Downloader used to download the response body and view the server * response. */ DbxDownloader<SharedLinkMetadata> getSharedLinkFile(GetSharedLinkMetadataArg arg, List<HttpRequestor.Header> _headers) throws GetSharedLinkFileErrorException, DbxException { try { return this.client.downloadStyle(this.client.getHost().getContent(), "2/sharing/get_shared_link_file", arg, false, _headers, GetSharedLinkMetadataArg.Serializer.INSTANCE, SharedLinkMetadata.Serializer.INSTANCE, GetSharedLinkFileError.Serializer.INSTANCE); } catch (DbxWrappedException ex) { throw new GetSharedLinkFileErrorException("2/sharing/get_shared_link_file", ex.getRequestId(), ex.getUserMessage(), (GetSharedLinkFileError) ex.getErrorValue()); } }
/** * Get a thumbnail for an image. This method currently supports files with * the following file extensions: jpg, jpeg, png, tiff, tif, gif and bmp. * Photos that are larger than 20MB in size won't be converted to a * thumbnail. * * @param _headers Extra headers to send with request. * * @return Downloader used to download the response body and view the server * response. */ DbxDownloader<FileMetadata> getThumbnail(ThumbnailArg arg, List<HttpRequestor.Header> _headers) throws ThumbnailErrorException, DbxException { try { return this.client.downloadStyle(this.client.getHost().getContent(), "2/files/get_thumbnail", arg, false, _headers, ThumbnailArg.Serializer.INSTANCE, FileMetadata.Serializer.INSTANCE, ThumbnailError.Serializer.INSTANCE); } catch (DbxWrappedException ex) { throw new ThumbnailErrorException("2/files/get_thumbnail", ex.getRequestId(), ex.getUserMessage(), (ThumbnailError) ex.getErrorValue()); } }
/** * Download a folder from the user's Dropbox, as a zip file. The folder must * be less than 20 GB in size and have fewer than 10,000 total files. The * input cannot be a single file. Any single file must be less than 4GB in * size. * * @param _headers Extra headers to send with request. * * @return Downloader used to download the response body and view the server * response. */ DbxDownloader<DownloadZipResult> downloadZip(DownloadZipArg arg, List<HttpRequestor.Header> _headers) throws DownloadZipErrorException, DbxException { try { return this.client.downloadStyle(this.client.getHost().getContent(), "2/files/download_zip", arg, false, _headers, DownloadZipArg.Serializer.INSTANCE, DownloadZipResult.Serializer.INSTANCE, DownloadZipError.Serializer.INSTANCE); } catch (DbxWrappedException ex) { throw new DownloadZipErrorException("2/files/download_zip", ex.getRequestId(), ex.getUserMessage(), (DownloadZipError) ex.getErrorValue()); } }
/** * Get a preview for a file. Currently, PDF previews are generated for files * with the following extensions: .ai, .doc, .docm, .docx, .eps, .odp, .odt, * .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx, .rtf. HTML previews are generated * for files with the following extensions: .csv, .ods, .xls, .xlsm, .xlsx. * Other formats will return an unsupported extension error. * * @param _headers Extra headers to send with request. * * @return Downloader used to download the response body and view the server * response. */ DbxDownloader<FileMetadata> getPreview(PreviewArg arg, List<HttpRequestor.Header> _headers) throws PreviewErrorException, DbxException { try { return this.client.downloadStyle(this.client.getHost().getContent(), "2/files/get_preview", arg, false, _headers, PreviewArg.Serializer.INSTANCE, FileMetadata.Serializer.INSTANCE, PreviewError.Serializer.INSTANCE); } catch (DbxWrappedException ex) { throw new PreviewErrorException("2/files/get_preview", ex.getRequestId(), ex.getUserMessage(), (PreviewError) ex.getErrorValue()); } }