public interface

ThumbnailAccessor

com.atlassian.jira.issue.attachment.ThumbnailAccessor
Known Indirect Subclasses

Summary

Public Methods
Promise<Void> deleteThumbnailDirectory(Issue issue)
Deletes the thumbnail directory for a given issue, deleting its contents if necessary.
File getLegacyThumbnailFile(Attachment attachment)
Returns the old legacy file name for thumbnails.
@Nonnull File getThumbnailDirectory(Issue issue)
Returns the physical directory of the thumbnails for the given issue, creating if necessary.
@Nonnull File getThumbnailDirectory(Issue issue, boolean createDirectory)
Returns the physical directory of the thumbnails for the given issue.
@Nonnull File getThumbnailFile(Attachment attachment)
Just like the attachments themselves, thumbnails can succumb to file system encoding problems.
@Nonnull File getThumbnailFile(Issue issue, Attachment attachment)
Returns the file handle for the given attachment's thumbnail.

Public Methods

public Promise<Void> deleteThumbnailDirectory (Issue issue)

Deletes the thumbnail directory for a given issue, deleting its contents if necessary.

Parameters
issue The issue whose thumbnail directory you want to delete.
Returns
  • A promise that contains a AttachmentCleanupException if there was an error deleting the directory.

public File getLegacyThumbnailFile (Attachment attachment)

Returns the old legacy file name for thumbnails.

http://jira.atlassian.com/browse/JRA-23311

Parameters
attachment the attachment in play
Returns
  • the full legacy thumbnail file name

@Nonnull public File getThumbnailDirectory (Issue issue)

Returns the physical directory of the thumbnails for the given issue, creating if necessary.

Parameters
issue the issue whose thumbnail directory you want
Returns
  • The issue's thumbnail directory.

@Nonnull public File getThumbnailDirectory (Issue issue, boolean createDirectory)

Returns the physical directory of the thumbnails for the given issue.

Parameters
issue the issue whose thumbnail directory you want
createDirectory If true, and the directory does not currently exist, then the directory is created.
Returns
  • The issue's thumbnail directory.

@Nonnull public File getThumbnailFile (Attachment attachment)

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

Parameters
attachment the attachment for which to get the thumbnail file
Returns
  • a non-null file handle (the file itself might not exist)

@Nonnull public File getThumbnailFile (Issue issue, Attachment attachment)

Returns the file handle for the given attachment's thumbnail. This method performs better than getThumbnailFile(Attachment) if you already have the issue.

Parameters
issue the issue to which the attachment belongs
attachment the attachment for which to get the thumbnail file
Returns
  • a non-null file handle (the file itself might not exist)