Class DefaultThumbnailAccessor

java.lang.Object
com.atlassian.jira.issue.attachment.DefaultThumbnailAccessor
All Implemented Interfaces:
ThumbnailAccessor

@ParametersAreNonnullByDefault public class DefaultThumbnailAccessor extends Object implements ThumbnailAccessor
  • Field Details

    • THUMBNAIL_DESIGNATION

      public static final String THUMBNAIL_DESIGNATION
      Infix for generated thumbnail images.
      See Also:
  • Constructor Details

    • DefaultThumbnailAccessor

      public DefaultThumbnailAccessor(StreamAttachmentStore streamAttachmentStore)
  • 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 interface ThumbnailAccessor
      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 than ThumbnailAccessor.getThumbnailFilePath(Attachment) if you already have the issue.
      Specified by:
      getThumbnailFilePath in interface ThumbnailAccessor
      Parameters:
      issue - the issue to which the attachment belongs
      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:
    • deleteThumbnailDirectory

      public io.atlassian.util.concurrent.Promise<Void> deleteThumbnailDirectory(@Nonnull Issue issue)
      Description copied from interface: ThumbnailAccessor
      Deletes the thumbnail directory for a given issue, deleting its contents if necessary.
      Specified by:
      deleteThumbnailDirectory in interface ThumbnailAccessor
      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.