@PublicApi public interface

ThumbnailManager

com.atlassian.jira.issue.thumbnail.ThumbnailManager
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

Provides key services for small-sized images representing image attachments on issues.

Summary

Fields
public static final Thumbnail.MimeType MIME_TYPE The JIRA global thumbnail MIME type.
Public Methods
boolean checkToolkit()
Checks whether there is an "Abstract Window Toolkit" (AWT Toolkit) available.
@Nullable Thumbnail getThumbnail(Attachment attachment)
Returns the Thumbnail that corresponds to an Attachment, or null if the given attachment is not an image.
@Nullable Thumbnail getThumbnail(Issue issue, Attachment attachment)
Returns the Thumbnail that corresponds to an Attachment, or null if the given attachment is not an image.
Collection<Thumbnail> getThumbnails(Issue issue, User user)
Retrieves Thumbnails for an Issue
boolean isThumbnailable(Attachment attachment)
Indicates whether JIRA can generate a thumbnail for the given attachment.
boolean isThumbnailable(Issue issue, Attachment attachment)
Indicates whether JIRA can generate a thumbnail for the given attachment.
<T> T streamThumbnailContent(Attachment attachment, InputStreamConsumer<T> consumer)
Get binary content of the thumbnail
@Nullable ThumbnailedImage toThumbnailedImage(Thumbnail thumbnail)
Converts a Thumbnail into an ThumbnailedImage.

Fields

public static final Thumbnail.MimeType MIME_TYPE

The JIRA global thumbnail MIME type.

Public Methods

public boolean checkToolkit ()

Checks whether there is an "Abstract Window Toolkit" (AWT Toolkit) available.

Returns
  • true if one is available

@Nullable public Thumbnail getThumbnail (Attachment attachment)

Returns the Thumbnail that corresponds to an Attachment, or null if the given attachment is not an image.

Parameters
attachment an Attachment
Returns
  • returns a Thumbnail, or null

@Nullable public Thumbnail getThumbnail (Issue issue, Attachment attachment)

Returns the Thumbnail that corresponds to an Attachment, or null if the given attachment is not an image.

Parameters
issue the issue for the attachment (passed in for performance reasons)
attachment an Attachment
Returns
  • returns a Thumbnail, or null

public Collection<Thumbnail> getThumbnails (Issue issue, User user)

Retrieves Thumbnails for an Issue

Parameters
issue the issue to get the thumnails for.
user the user on whose behalf the request is made.
Returns
  • the thumbnails.
Throws
Exception

public boolean isThumbnailable (Attachment attachment)

Indicates whether JIRA can generate a thumbnail for the given attachment.

Parameters
attachment the attachment (required)
Returns
  • see above
Throws
GenericEntityException
GenericEntityException

public boolean isThumbnailable (Issue issue, Attachment attachment)

Indicates whether JIRA can generate a thumbnail for the given attachment. This method may perform better than isThumbnailable(com.atlassian.jira.issue.attachment.Attachment) because it doesn't need to look up the issue.

Parameters
issue the issue to which the attachment relates (if null, this method will look it up)
attachment the attachment (required)
Returns
  • see above
Throws
GenericEntityException
GenericEntityException

public T streamThumbnailContent (Attachment attachment, InputStreamConsumer<T> consumer)

Get binary content of the thumbnail

Throws
IOException

@Nullable public ThumbnailedImage toThumbnailedImage (Thumbnail thumbnail)

Converts a Thumbnail into an ThumbnailedImage. The ThumbnailedImage is an analog of the atlassian-core Thumbnail but it contains JIRA-specific methods for getting the image URL, etc.

Parameters
thumbnail a Thumbnail, or null
Returns
  • an ImageThumbnail, or null