public interface ThumbnailManager
| Modifier and Type | Field and Description |
|---|---|
static String |
THUMBNAIL_IMAGE_DARK_FEATURE |
static String |
THUMBNAIL_PATH_SUFFIX
Deprecated.
since 7.12 use
ThumbnailManagerInternal.THUMBNAIL_DIR_NAME |
| Modifier and Type | Method and Description |
|---|---|
com.atlassian.core.util.thumbnail.Thumbnail |
getThumbnail(@NonNull Attachment attachment)
Returns a thumbnail for this attachment having ensured the thumbnail exists in the filesystem, generating it only
if it doesn't already exist.
|
com.atlassian.core.util.thumbnail.Thumbnail |
getThumbnail(@NonNull Attachment attachment,
@Nullable ImageDimensions imageDimensions)
Returns a thumbnail for this attachment having ensured the thumbnail exists in the filesystem, generating it only
if it doesn't already exist.
|
InputStream |
getThumbnailData(@NonNull Attachment attachment)
Retrieves the thumbnail data (as a stream) of the latest version from where it was stored in the file system.
|
InputStream |
getThumbnailData(@NonNull Attachment attachment,
@Nullable ImageDimensions imageDimensions)
Retrieves the thumbnail data (as a stream) of the latest version from where it was stored in the file system.
|
File |
getThumbnailFile(@NonNull Attachment attachment)
Deprecated.
|
File |
getThumbnailFile(@NonNull Attachment attachment,
@Nullable ImageDimensions imageDimensions)
Deprecated.
|
File |
getThumbnailFile(long attachmentId,
int version,
long contentId)
Deprecated.
since 7.12 use
ThumbnailManagerInternal.getThumbnailFile(long, int, long) |
ThumbnailInfo |
getThumbnailInfo(@NonNull Attachment attachment)
Return the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk.
|
ThumbnailInfo |
getThumbnailInfo(@NonNull Attachment attachment,
@Nullable ImageDimensions imageDimensions)
Return the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk.
|
ThumbnailInfo |
getThumbnailInfo(@NonNull Attachment attachment,
@Nullable String rootAttachmentPath)
Return the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk.
|
ThumbnailInfo |
getThumbnailInfo(@NonNull Attachment attachment,
@Nullable String rootAttachmentPath,
@Nullable ImageDimensions imageDimensions)
Return the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk.
|
boolean |
isThumbnailable(@Nullable Attachment attachment)
Checks the content type/mime type of the attachment to determine whether a thumbnail can be created from it
|
boolean |
isThumbnailable(@Nullable ThumbnailInfo info)
Check the thumbnail information to determine whether a thumbnail can be created from it
|
boolean |
removeThumbnail(@NonNull Attachment attachment)
Removes the thumbnail for the specified attachment
|
@Deprecated static final String THUMBNAIL_PATH_SUFFIX
ThumbnailManagerInternal.THUMBNAIL_DIR_NAMEstatic final String THUMBNAIL_IMAGE_DARK_FEATURE
boolean isThumbnailable(@Nullable Attachment attachment)
attachment - the attachmentInputStream getThumbnailData(@NonNull Attachment attachment) throws FileNotFoundException
attachment - the attachmentFileNotFoundException - if the thumbnail file is not foundInputStream getThumbnailData(@NonNull Attachment attachment, @Nullable ImageDimensions imageDimensions) throws FileNotFoundException
attachment - the attachmentimageDimensions - image dimensions of the thumbnailFileNotFoundException - if the thumbnail file is not found@Deprecated File getThumbnailFile(long attachmentId, int version, long contentId)
ThumbnailManagerInternal.getThumbnailFile(long, int, long)@Deprecated File getThumbnailFile(@NonNull Attachment attachment)
ThumbnailManagerInternal.getThumbnailFile(Attachment, ImageDimensions)attachment - the attachment@Deprecated File getThumbnailFile(@NonNull Attachment attachment, @Nullable ImageDimensions imageDimensions)
ThumbnailManagerInternal.getThumbnailFile(Attachment, ImageDimensions)attachment - the attachmentimageDimensions - image dimensions of the thumbnailboolean removeThumbnail(@NonNull Attachment attachment)
attachment - the attachmentcom.atlassian.core.util.thumbnail.Thumbnail getThumbnail(@NonNull Attachment attachment) throws IllegalArgumentException
attachment - the attachmentIllegalArgumentException - if the attachment is an inappropriate type for thumbnailing, i.e. isThumbnailable(Attachment) returns falsecom.atlassian.core.util.thumbnail.Thumbnail getThumbnail(@NonNull Attachment attachment, @Nullable ImageDimensions imageDimensions) throws IllegalArgumentException
attachment - the attachmentimageDimensions - image dimensions of the thumbnailIllegalArgumentException - if the attachment is an inappropriate type for thumbnailing, i.e. isThumbnailable(Attachment) returns falseThumbnailInfo getThumbnailInfo(@NonNull Attachment attachment) throws CannotGenerateThumbnailException
attachment - the attachmentCannotGenerateThumbnailException - if no thumbnail information can be generated for this thumbnailThumbnailInfo getThumbnailInfo(@NonNull Attachment attachment, @Nullable ImageDimensions imageDimensions) throws CannotGenerateThumbnailException
attachment - the attachmentimageDimensions - image dimensions of the thumbnailCannotGenerateThumbnailException - if no thumbnail information can be generated for this thumbnailThumbnailInfo getThumbnailInfo(@NonNull Attachment attachment, @Nullable String rootAttachmentPath) throws CannotGenerateThumbnailException
attachment - the attachmentrootAttachmentPath - path to the thumbnail, excepting the thumbnail itself. Eg the value returned by ConfluenceRenderUtils.getAttachmentRemotePath(com.atlassian.confluence.pages.Attachment).CannotGenerateThumbnailException - if no thumbnail information can be generated for this thumbnailThumbnailInfo getThumbnailInfo(@NonNull Attachment attachment, @Nullable String rootAttachmentPath, @Nullable ImageDimensions imageDimensions) throws CannotGenerateThumbnailException
attachment - the attachmentrootAttachmentPath - path to the thumbnail, excepting the thumbnail itself. Eg the value returned by ConfluenceRenderUtils.getAttachmentRemotePath(com.atlassian.confluence.pages.Attachment).imageDimensions - image dimensions of the thumbnailCannotGenerateThumbnailException - if no thumbnail information can be generated for this thumbnailboolean isThumbnailable(@Nullable ThumbnailInfo info)
info - the thumbnail informationCopyright © 2003–2021 Atlassian. All rights reserved.