@PublicApi
public interface ThumbnailManager
Modifier and Type | Field and Description |
---|---|
static com.atlassian.core.util.thumbnail.Thumbnail.MimeType |
MIME_TYPE
The JIRA global thumbnail MIME type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkToolkit()
Checks whether there is an "Abstract Window Toolkit" (AWT Toolkit) available.
|
void |
deleteThumbnailForAttachment(Issue issue,
Attachment attachment)
Deletes the generated thumbnail for an attachment, if exists.
|
void |
deleteThumbnailsForIssue(Issue issue)
Deletes the generated thumbnails for the attachments of an issue.
|
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.
|
com.atlassian.core.util.thumbnail.Thumbnail |
getThumbnailDeferred(Issue issue,
Attachment attachment)
A simplified implementation of the
getThumbnail(Issue, Attachment)
returning only thumbnail mock objects with default dimensions instead of reading
existing dimensions from mock file
This is speed optimisation and works for internal purposes AttachmentViewDtoConverter.convert(java.util.List) |
Collection<com.atlassian.core.util.thumbnail.Thumbnail> |
getThumbnails(Issue issue,
ApplicationUser 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
|
ThumbnailedImage |
toThumbnailedImage(com.atlassian.core.util.thumbnail.Thumbnail thumbnail)
Converts a Thumbnail into an ThumbnailedImage.
|
static final com.atlassian.core.util.thumbnail.Thumbnail.MimeType MIME_TYPE
Collection<com.atlassian.core.util.thumbnail.Thumbnail> getThumbnails(Issue issue, ApplicationUser user) throws Exception
Thumbnails
for an Issue
issue
- the issue to get the thumnails for.user
- the user on whose behalf the request is made.Exception
toThumbnailedImage(com.atlassian.core.util.thumbnail.Thumbnail)
boolean isThumbnailable(Attachment attachment) throws org.ofbiz.core.entity.GenericEntityException
attachment
- the attachment (required)org.ofbiz.core.entity.GenericEntityException
isThumbnailable(com.atlassian.jira.issue.Issue, com.atlassian.jira.issue.attachment.Attachment)
boolean isThumbnailable(@Nullable Issue issue, Attachment attachment) throws org.ofbiz.core.entity.GenericEntityException
isThumbnailable(com.atlassian.jira.issue.attachment.Attachment)
because it doesn't need to look up the issue.issue
- the issue to which the attachment relates (if null, this method will look it up)attachment
- the attachment (required)org.ofbiz.core.entity.GenericEntityException
isThumbnailable(com.atlassian.jira.issue.attachment.Attachment)
@Nullable com.atlassian.core.util.thumbnail.Thumbnail getThumbnailDeferred(Issue issue, Attachment attachment)
getThumbnail(Issue, Attachment)
returning only thumbnail mock objects with default dimensions instead of reading
existing dimensions from mock file
This is speed optimisation and works for internal purposes AttachmentViewDtoConverter.convert(java.util.List)
issue
- the issue for the attachment (passed in for performance reasons)attachment
- an Attachmentboolean checkToolkit()
@Nullable com.atlassian.core.util.thumbnail.Thumbnail getThumbnail(Attachment attachment)
attachment
- an AttachmenttoThumbnailedImage(com.atlassian.core.util.thumbnail.Thumbnail)
@Nullable com.atlassian.core.util.thumbnail.Thumbnail getThumbnail(Issue issue, Attachment attachment)
issue
- the issue for the attachment (passed in for performance reasons)attachment
- an AttachmenttoThumbnailedImage(com.atlassian.core.util.thumbnail.Thumbnail)
@Nullable ThumbnailedImage toThumbnailedImage(@Nullable com.atlassian.core.util.thumbnail.Thumbnail thumbnail)
thumbnail
- a Thumbnail, or null<T> T streamThumbnailContent(Attachment attachment, InputStreamConsumer<T> consumer) throws IOException
T
- The class that the consumer returns when run.attachment
- an Attachmentconsumer
- function that consumes the thumbnail data.IOException
- if something wrong happens while reading the thumbnail data.void deleteThumbnailForAttachment(@Nullable Issue issue, Attachment attachment)
issue
- the issue for the attachment (passed in for performance reasons)attachment
- an AttachmentCopyright © 2002-2022 Atlassian. All Rights Reserved.