com.atlassian.jira.issue.attachment
Interface ThumbnailAccessor

All Known Implementing Classes:
FileSystemThumbnailAccessor, WithDirectoryAccessorThumbnailAccessor

public interface ThumbnailAccessor


Method Summary
 com.atlassian.util.concurrent.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.
 File getThumbnailDirectory(Issue issue)
          Returns the physical directory of the thumbnails for the given issue, creating if necessary.
 File getThumbnailFile(Attachment attachment)
          Just like the attachments themselves, thumbnails can succumb to file system encoding problems.
 File getThumbnailFile(Issue issue, Attachment attachment)
          Returns the file handle for the given attachment's thumbnail.
 

Method Detail

getThumbnailFile

@Nonnull
File getThumbnailFile(@Nonnull
                              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 epheral 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)
See Also:
getThumbnailFile(com.atlassian.jira.issue.Issue, Attachment)

getThumbnailFile

@Nonnull
File getThumbnailFile(@Nonnull
                              Issue issue,
                              @Nonnull
                              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)
See Also:
getThumbnailFile(Attachment)

getLegacyThumbnailFile

File getLegacyThumbnailFile(@Nonnull
                            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

getThumbnailDirectory

@Nonnull
File getThumbnailDirectory(@Nonnull
                                   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.

deleteThumbnailDirectory

com.atlassian.util.concurrent.Promise<Void> deleteThumbnailDirectory(@Nonnull
                                                                     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.


Copyright © 2002-2014 Atlassian. All Rights Reserved.