Package com.dropbox.core.v2.files
Class DbxUserGetThumbnailV2Builder
java.lang.Object
com.dropbox.core.v2.DbxDownloadStyleBuilder<PreviewResult>
com.dropbox.core.v2.files.DbxUserGetThumbnailV2Builder
The request builder returned by
DbxUserFilesRequests.getThumbnailV2Builder(com.dropbox.core.v2.files.PathOrLink).
Use this class to set optional request parameters and complete the request.
-
Method Summary
Modifier and TypeMethodDescriptionstart()Issues the download request using this builder's request parameters and returns aDbxDownloaderfor reading the response body.withExcludeMediaInfo(Boolean excludeMediaInfo) Set value for optional field.withFormat(ThumbnailFormat format) Set value for optional field.withMode(ThumbnailMode mode) Set value for optional field.withQuality(ThumbnailQuality quality) Set value for optional field.withSize(ThumbnailSize size) Set value for optional field.Methods inherited from class com.dropbox.core.v2.DbxDownloadStyleBuilder
download, getHeaders, range, range
-
Method Details
-
withFormat
Set value for optional field.If left unset or set to
null, defaults toThumbnailFormat.JPEG.- Parameters:
format- The format for the thumbnail image, jpeg (default), png, or webp. For images that are photos, jpeg should be preferred, while png is better for screenshots and digital arts, and web for compression. Must not benull. Defaults toThumbnailFormat.JPEGwhen set tonull.- Returns:
- this builder
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
withSize
Set value for optional field.If left unset or set to
null, defaults toThumbnailSize.W64H64.- Parameters:
size- The size for the thumbnail image. Must not benull. Defaults toThumbnailSize.W64H64when set tonull.- Returns:
- this builder
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
withMode
Set value for optional field.If left unset or set to
null, defaults toThumbnailMode.STRICT.- Parameters:
mode- How to resize and crop the image to achieve the desired size. Must not benull. Defaults toThumbnailMode.STRICTwhen set tonull.- Returns:
- this builder
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
withQuality
Set value for optional field.If left unset or set to
null, defaults toThumbnailQuality.QUALITY_80.- Parameters:
quality- Quality of the thumbnail image. Must not benull. Defaults toThumbnailQuality.QUALITY_80when set tonull.- Returns:
- this builder
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
withExcludeMediaInfo
Set value for optional field.- Parameters:
excludeMediaInfo- Normally,FileMetadata.getMediaInfo()is set for photo and video. When this flag is true,FileMetadata.getMediaInfo()is not populated. This improves latency for use cases where `media_info` is not needed.- Returns:
- this builder
-
start
Description copied from class:DbxDownloadStyleBuilderIssues the download request using this builder's request parameters and returns aDbxDownloaderfor reading the response body. Callers should fully read the response body usingDbxDownloader.getInputStream()and close the downloader afterwards (seeDbxDownloader.close()). This will allow for proper resource deallocation and connection re-use.. SeeDbxDownloadStyleBuilder.download(java.io.OutputStream)convenience method for a simpler way to complete the request.- Specified by:
startin classDbxDownloadStyleBuilder<PreviewResult>- Returns:
DbxDownloaderused to download data and read the response.- Throws:
DbxException- if an error occursing issuing the requestThumbnailV2ErrorException
-