com.atlassian.jira.issue.thumbnail
Interface ThumbnailManager

All Known Implementing Classes:
DefaultThumbnailManager, DisabledThumbNailManager

@PublicApi
public interface ThumbnailManager

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


Field Summary
static com.atlassian.core.util.thumbnail.Thumbnail.MimeType MIME_TYPE
          The JIRA global thumbnail MIME type.
 
Method Summary
 boolean checkToolkit()
          Checks if there is an "Abstract Window Toolkit" (AWT Toolkit) available.
 com.atlassian.core.util.thumbnail.Thumbnail getThumbnail(Attachment attachment)
          Returns the Thumbnail that corresponds to an Attachment, or null if the given attachment is not an image.
 com.atlassian.core.util.thumbnail.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<com.atlassian.core.util.thumbnail.Thumbnail> getThumbnails(Issue issue, com.atlassian.crowd.embedded.api.User user)
          Retrieves Thumbnails for an Issue
 boolean isThumbnailable(Attachment attachmentGV)
           
 boolean isThumbnailable(Issue issue, Attachment attachmentGV)
           
<T> T
streamThumbnailContent(Attachment attachment, InputStreamConsumer<T> consumer)
          Get binary content of the thumbnail
 ThumbnailedImage toThumbnailedImage(com.atlassian.core.util.thumbnail.Thumbnail thumbnail)
          Converts a Thumbnail into an ThumbnailedImage.
 

Field Detail

MIME_TYPE

static final com.atlassian.core.util.thumbnail.Thumbnail.MimeType MIME_TYPE
The JIRA global thumbnail MIME type.

Method Detail

getThumbnails

Collection<com.atlassian.core.util.thumbnail.Thumbnail> getThumbnails(Issue issue,
                                                                      com.atlassian.crowd.embedded.api.User user)
                                                                      throws Exception
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
See Also:
toThumbnailedImage(com.atlassian.core.util.thumbnail.Thumbnail)

isThumbnailable

boolean isThumbnailable(Attachment attachmentGV)
                        throws org.ofbiz.core.entity.GenericEntityException
Throws:
org.ofbiz.core.entity.GenericEntityException

isThumbnailable

boolean isThumbnailable(Issue issue,
                        Attachment attachmentGV)
                        throws org.ofbiz.core.entity.GenericEntityException
Throws:
org.ofbiz.core.entity.GenericEntityException

checkToolkit

boolean checkToolkit()
Checks if there is an "Abstract Window Toolkit" (AWT Toolkit) available.

Returns:
true if there is an "Abstract Window Toolkit" (AWT Toolkit) available.

getThumbnail

@Nullable
com.atlassian.core.util.thumbnail.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
See Also:
toThumbnailedImage(com.atlassian.core.util.thumbnail.Thumbnail)

getThumbnail

@Nullable
com.atlassian.core.util.thumbnail.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
See Also:
toThumbnailedImage(com.atlassian.core.util.thumbnail.Thumbnail)

toThumbnailedImage

@Nullable
ThumbnailedImage toThumbnailedImage(@Nullable
                                             com.atlassian.core.util.thumbnail.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
Since:
v5.2

streamThumbnailContent

<T> T streamThumbnailContent(Attachment attachment,
                             InputStreamConsumer<T> consumer)
                         throws IOException
Get binary content of the thumbnail

Parameters:
attachment -
consumer -
Returns:
Throws:
IOException


Copyright © 2002-2013 Atlassian. All Rights Reserved.