public class DefaultThumbnailManager extends Object implements ThumbnailManager
MIME_TYPE| Constructor and Description |
|---|
DefaultThumbnailManager(ThumbnailConfiguration thumbnailConfiguration,
AttachmentManager attachmentManager,
MimeManager mimeManager,
VelocityRequestContextFactory velocityRequestContextFactory,
AttachmentStore attachmentStore,
ThumbnailAccessor thumbnailAccessor,
ApplicationProperties applicationProperties,
FeatureManager featureManager) |
| 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
ThumbnailManager.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.
|
public DefaultThumbnailManager(ThumbnailConfiguration thumbnailConfiguration, AttachmentManager attachmentManager, MimeManager mimeManager, VelocityRequestContextFactory velocityRequestContextFactory, AttachmentStore attachmentStore, ThumbnailAccessor thumbnailAccessor, ApplicationProperties applicationProperties, FeatureManager featureManager)
public Collection<com.atlassian.core.util.thumbnail.Thumbnail> getThumbnails(Issue issue, ApplicationUser user)
ThumbnailManagerThumbnails for an IssuegetThumbnails in interface ThumbnailManagerissue - the issue to get the thumnails for.user - the user on whose behalf the request is made.ThumbnailManager.toThumbnailedImage(com.atlassian.core.util.thumbnail.Thumbnail)public boolean isThumbnailable(Issue issue, Attachment attachment)
ThumbnailManagerThumbnailManager.isThumbnailable(com.atlassian.jira.issue.attachment.Attachment)
because it doesn't need to look up the issue.isThumbnailable in interface ThumbnailManagerissue - the issue to which the attachment relates (if null, this method will look it up)attachment - the attachment (required)ThumbnailManager.isThumbnailable(com.atlassian.jira.issue.attachment.Attachment)public boolean isThumbnailable(Attachment attachment)
ThumbnailManagerisThumbnailable in interface ThumbnailManagerattachment - the attachment (required)ThumbnailManager.isThumbnailable(com.atlassian.jira.issue.Issue, com.atlassian.jira.issue.attachment.Attachment)public com.atlassian.core.util.thumbnail.Thumbnail getThumbnail(Attachment attachment)
ThumbnailManagergetThumbnail in interface ThumbnailManagerattachment - an AttachmentThumbnailManager.toThumbnailedImage(com.atlassian.core.util.thumbnail.Thumbnail)public com.atlassian.core.util.thumbnail.Thumbnail getThumbnail(Issue issue, Attachment attachment)
ThumbnailManagergetThumbnail in interface ThumbnailManagerissue - the issue for the attachment (passed in for performance reasons)attachment - an AttachmentThumbnailManager.toThumbnailedImage(com.atlassian.core.util.thumbnail.Thumbnail)@Nullable public com.atlassian.core.util.thumbnail.Thumbnail getThumbnailDeferred(Issue issue, Attachment attachment)
ThumbnailManagerThumbnailManager.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)getThumbnailDeferred in interface ThumbnailManagerissue - the issue for the attachment (passed in for performance reasons)attachment - an Attachmentpublic boolean checkToolkit()
ThumbnailManagercheckToolkit in interface ThumbnailManagerpublic ThumbnailedImage toThumbnailedImage(@Nullable com.atlassian.core.util.thumbnail.Thumbnail thumbnail)
ThumbnailManagertoThumbnailedImage in interface ThumbnailManagerthumbnail - a Thumbnail, or nullpublic <T> T streamThumbnailContent(Attachment attachment, InputStreamConsumer<T> consumer) throws IOException
ThumbnailManagerstreamThumbnailContent in interface ThumbnailManagerT - 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.public void deleteThumbnailForAttachment(@Nullable Issue issue, Attachment attachment)
ThumbnailManagerdeleteThumbnailForAttachment in interface ThumbnailManagerissue - the issue for the attachment (passed in for performance reasons)attachment - an Attachmentpublic void deleteThumbnailsForIssue(@Nonnull Issue issue)
ThumbnailManagerdeleteThumbnailsForIssue in interface ThumbnailManagerissue - the issue whose attachments' thumbnails will be deleted.Copyright © 2002-2022 Atlassian. All Rights Reserved.