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 by DbxUserFilesRequests.getThumbnailBuilder(java.lang.String).

Use this class to set optional request parameters and complete the request.

  • Method Details

    • withFormat

      public GetThumbnailBuilder withFormat(ThumbnailFormat format)
      Set value for optional field.

      If left unset or set to null, defaults to ThumbnailFormat.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 be null. Defaults to ThumbnailFormat.JPEG when set to null.
      Returns:
      this builder
      Throws:
      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 to ThumbnailSize.W64H64.

      Parameters:
      size - The size for the thumbnail image. Must not be null. Defaults to ThumbnailSize.W64H64 when set to null.
      Returns:
      this builder
      Throws:
      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 to ThumbnailMode.STRICT.

      Parameters:
      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.
      Returns:
      this builder
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • withQuality

      public GetThumbnailBuilder withQuality(ThumbnailQuality quality)
      Set value for optional field.

      If left unset or set to null, defaults to ThumbnailQuality.QUALITY_80.

      Parameters:
      quality - Quality of the thumbnail image. Must not be null. Defaults to ThumbnailQuality.QUALITY_80 when set to null.
      Returns:
      this builder
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • withExcludeMediaInfo

      public GetThumbnailBuilder withExcludeMediaInfo(Boolean excludeMediaInfo)
      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: DbxDownloadStyleBuilder
      Issues the download request using this builder's request parameters and returns a 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.
      Specified by:
      start in class DbxDownloadStyleBuilder<FileMetadata>
      Returns:
      DbxDownloader used to download data and read the response.
      Throws:
      DbxException - if an error occursing issuing the request
      ThumbnailErrorException