public class GetThumbnailBuilder extends DbxDownloadStyleBuilder<FileMetadata>
DbxUserFilesRequests.getThumbnailBuilder(java.lang.String)
.
Use this class to set optional request parameters and complete the request.
Modifier and Type | Method and Description |
---|---|
DbxDownloader<FileMetadata> |
start()
Issues the download request using this builder's request parameters and returns a
DbxDownloader for reading the response body. |
GetThumbnailBuilder |
withFormat(ThumbnailFormat format)
Set value for optional field.
|
GetThumbnailBuilder |
withSize(ThumbnailSize size)
Set value for optional field.
|
download, getHeaders, range, range
public GetThumbnailBuilder 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
.IllegalArgumentException
- If any argument does not meet its
preconditions.public GetThumbnailBuilder 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
.IllegalArgumentException
- If any argument does not meet its
preconditions.public DbxDownloader<FileMetadata> start() throws ThumbnailErrorException, 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<FileMetadata>
DbxDownloader
used to download data and read the response.DbxException
- if an error occursing issuing the requestThumbnailErrorException