Class DefaultThumbnailAccessor
java.lang.Object
com.atlassian.jira.issue.attachment.DefaultThumbnailAccessor
- All Implemented Interfaces:
ThumbnailAccessor
@ParametersAreNonnullByDefault
public class DefaultThumbnailAccessor
extends Object
implements ThumbnailAccessor
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.atlassian.util.concurrent.Promise<Void>
deleteThumbnailDirectory
(Issue issue) Deletes the thumbnail directory for a given issue, deleting its contents if necessary.com.atlassian.dc.filestore.api.FileStore.Path
getThumbnailFilePath
(Attachment attachment) Just like the attachments themselves, thumbnails can succumb to file system encoding problems.com.atlassian.dc.filestore.api.FileStore.Path
getThumbnailFilePath
(Issue issue, Attachment attachment) Returns the file path for the given attachment's thumbnail.
-
Field Details
-
THUMBNAIL_DESIGNATION
Infix for generated thumbnail images.- See Also:
-
-
Constructor Details
-
DefaultThumbnailAccessor
-
-
Method Details
-
getThumbnailFilePath
@Nonnull public com.atlassian.dc.filestore.api.FileStore.Path getThumbnailFilePath(Attachment attachment) Description copied from interface:ThumbnailAccessor
Just like the attachments themselves, thumbnails can succumb to file system encoding problems. However we are going to regenerate thumbnails by only using the new naming scheme and not the legacy one. We cant do this for attachments but we can for thumbnails since they are ephemeral objects anyway.http://jira.atlassian.com/browse/JRA-23311
- Specified by:
getThumbnailFilePath
in interfaceThumbnailAccessor
- Parameters:
attachment
- the attachment for which to get the thumbnail file path- Returns:
- a non-null file path (the file itself might not exist)
- See Also:
-
getThumbnailFilePath
@Nonnull public com.atlassian.dc.filestore.api.FileStore.Path getThumbnailFilePath(Issue issue, Attachment attachment) Description copied from interface:ThumbnailAccessor
Returns the file path for the given attachment's thumbnail. This method performs better thanThumbnailAccessor.getThumbnailFilePath(Attachment)
if you already have the issue.- Specified by:
getThumbnailFilePath
in interfaceThumbnailAccessor
- Parameters:
issue
- the issue to which the attachment belongsattachment
- the attachment for which to get the thumbnail file path- Returns:
- a non-null file path (the file itself might not exist)
- See Also:
-
deleteThumbnailDirectory
Description copied from interface:ThumbnailAccessor
Deletes the thumbnail directory for a given issue, deleting its contents if necessary.- Specified by:
deleteThumbnailDirectory
in interfaceThumbnailAccessor
- Parameters:
issue
- The issue whose thumbnail path you want to delete.- Returns:
- A promise that contains a AttachmentCleanupException if there was an error deleting the path.
-