public class DbxAppGetThumbnailV2Builder extends DbxDownloadStyleBuilder<PreviewResult>
DbxAppFilesRequests.getThumbnailV2Builder(com.dropbox.core.v2.files.PathOrLink)
.
Use this class to set optional request parameters and complete the request.
Modifier and Type | Method and Description |
---|---|
DbxDownloader<PreviewResult> |
start()
Issues the download request using this builder's request parameters and returns a
DbxDownloader for reading the response body. |
DbxAppGetThumbnailV2Builder |
withFormat(ThumbnailFormat format)
Set value for optional field.
|
DbxAppGetThumbnailV2Builder |
withMode(ThumbnailMode mode)
Set value for optional field.
|
DbxAppGetThumbnailV2Builder |
withSize(ThumbnailSize size)
Set value for optional field.
|
download, getHeaders, range, range
public DbxAppGetThumbnailV2Builder withFormat(ThumbnailFormat format)
If left unset or set to null
, defaults to ThumbnailFormat.JPEG
.
format
- The format for the thumbnail image, jpeg (default) or png.
For images that are photos, jpeg should be preferred, while png is
better for screenshots and digital arts. Must not be null
.
Defaults to ThumbnailFormat.JPEG
when set to null
.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public DbxAppGetThumbnailV2Builder withSize(ThumbnailSize size)
If left unset or set to null
, defaults to ThumbnailSize.W64H64
.
size
- The size for the thumbnail image. Must not be null
.
Defaults to ThumbnailSize.W64H64
when set to null
.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public DbxAppGetThumbnailV2Builder withMode(ThumbnailMode mode)
If left unset or set to null
, defaults to ThumbnailMode.STRICT
.
mode
- How to resize and crop the image to achieve the desired
size. Must not be null
. Defaults to ThumbnailMode.STRICT
when set to null
.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public DbxDownloader<PreviewResult> start() throws ThumbnailV2ErrorException, DbxException
DbxDownloadStyleBuilder
DbxDownloader
for reading the response body.
Callers should fully read the response body using DbxDownloader.getInputStream()
and
close the downloader afterwards (see DbxDownloader.close()
). This will allow for proper
resource deallocation and connection re-use..
See DbxDownloadStyleBuilder.download(java.io.OutputStream)
convenience method for a simpler way to complete the request.start
in class DbxDownloadStyleBuilder<PreviewResult>
DbxDownloader
used to download data and read the response.DbxException
- if an error occursing issuing the requestThumbnailV2ErrorException