Package com.dropbox.core.v2.files
Class GetThumbnailBuilder
- java.lang.Object
-
- com.dropbox.core.v2.DbxDownloadStyleBuilder<FileMetadata>
-
- com.dropbox.core.v2.files.GetThumbnailBuilder
-
public class GetThumbnailBuilder extends DbxDownloadStyleBuilder<FileMetadata>
The request builder returned byDbxUserFilesRequests.getThumbnailBuilder(java.lang.String)
.Use this class to set optional request parameters and complete the request.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DbxDownloader<FileMetadata>
start()
Issues the download request using this builder's request parameters and returns aDbxDownloader
for reading the response body.GetThumbnailBuilder
withFormat(ThumbnailFormat format)
Set value for optional field.GetThumbnailBuilder
withMode(ThumbnailMode mode)
Set value for optional field.GetThumbnailBuilder
withSize(ThumbnailSize size)
Set value for optional field.-
Methods inherited from class com.dropbox.core.v2.DbxDownloadStyleBuilder
download, getHeaders, range, range
-
-
-
-
Method Detail
-
withFormat
public GetThumbnailBuilder withFormat(ThumbnailFormat format)
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) or png. For images that are photos, jpeg should be preferred, while png is better for screenshots and digital arts. Must not benull
. Defaults toThumbnailFormat.JPEG
when set tonull
.- Returns:
- this builder
- Throws:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.
-
withSize
public GetThumbnailBuilder withSize(ThumbnailSize size)
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.W64H64
when set tonull
.- Returns:
- this builder
- Throws:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.
-
withMode
public GetThumbnailBuilder withMode(ThumbnailMode mode)
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.STRICT
when set tonull
.- Returns:
- this builder
- Throws:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.
-
start
public DbxDownloader<FileMetadata> start() throws ThumbnailErrorException, DbxException
Description copied from class:DbxDownloadStyleBuilder
Issues the download request using this builder's request parameters and returns aDbxDownloader
for 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:
start
in classDbxDownloadStyleBuilder<FileMetadata>
- Returns:
DbxDownloader
used to download data and read the response.- Throws:
DbxException
- if an error occursing issuing the requestThumbnailErrorException
-
-