public class DefaultThumbnailManager extends Object implements ThumbnailManager
THUMBNAIL_IMAGE_DARK_FEATURE, THUMBNAIL_PATH_SUFFIX
Constructor and Description |
---|
DefaultThumbnailManager() |
Modifier and Type | Method and Description |
---|---|
com.atlassian.core.util.thumbnail.Thumber |
getThumber()
Deprecated.
since 3.5
|
com.atlassian.core.util.thumbnail.Thumbnail |
getThumbnail(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(Attachment attachment,
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(Attachment attachment)
Retrieves the thumbnail data (as a stream) of the latest version from where it was stored in the file system.
|
InputStream |
getThumbnailData(Attachment attachment,
ImageDimensions imageDimensions)
Retrieves the thumbnail data (as a stream) of the latest version from where it was stored in the file system.
|
File |
getThumbnailFile(Attachment attachment)
Returns the path to the thumbnail for this attachment
|
File |
getThumbnailFile(Attachment attachment,
ImageDimensions imageDimensions)
Returns the path to the thumbnail for this attachment
|
File |
getThumbnailFile(long attachmentId,
int version,
long contentId) |
ThumbnailInfo |
getThumbnailInfo(Attachment attachment)
Return the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk.
|
ThumbnailInfo |
getThumbnailInfo(Attachment attachment,
ImageDimensions imageDimensions)
Return the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk.
|
ThumbnailInfo |
getThumbnailInfo(Attachment attachment,
String remoteAttachmentPath)
Return the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk.
|
ThumbnailInfo |
getThumbnailInfo(Attachment attachment,
String remoteAttachmentPath,
ImageDimensions imageDimensions)
Return the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk.
|
DelegatingThumbnailRenderer |
getThumbnailRenderer()
Deprecated.
since 5.4
|
Collection<com.atlassian.core.util.thumbnail.Thumbnail> |
getThumbnails(Collection<Attachment> attachments)
Deprecated.
|
protected File |
getThumbnailsFolder(Attachment attachment) |
boolean |
isThumbnailable(Attachment attachment)
Checks the content type/mime type of the attachment to determine whether a thumbnail can be created from it
|
boolean |
isThumbnailable(InputStream imageData)
Deprecated.
since 3.5 - not used
|
static boolean |
isThumbnailable(String mimeType) |
boolean |
isThumbnailable(ThumbnailInfo info)
Check the thumbnail information to determine whether a thumbnail can be created from it
|
boolean |
removeThumbnail(Attachment attachment)
Removes the thumbnail for the specified attachment
|
void |
setBootstrapManager(BootstrapManager bootstrapManager) |
void |
setImageDetailsManager(ImageDetailsManager imageDetailsManager) |
void |
setSettingsManager(SettingsManager settingsManager) |
void |
setThumbnailRenderer(DelegatingThumbnailRenderer thumbnailRenderer) |
public boolean isThumbnailable(@Nullable Attachment attachment)
ThumbnailManager
isThumbnailable
in interface ThumbnailManager
attachment
- the attachmentpublic static boolean isThumbnailable(String mimeType)
public boolean isThumbnailable(@Nonnull ThumbnailInfo info)
ThumbnailManager
isThumbnailable
in interface ThumbnailManager
info
- the thumbnail information@Deprecated public boolean isThumbnailable(InputStream imageData)
isThumbnailable
in interface ThumbnailManager
public InputStream getThumbnailData(@Nonnull Attachment attachment) throws FileNotFoundException
getThumbnailData
in interface ThumbnailManager
attachment
- the attachmentFileNotFoundException
- if the thumbnail file is not foundpublic InputStream getThumbnailData(@Nonnull Attachment attachment, @Nullable ImageDimensions imageDimensions) throws FileNotFoundException
getThumbnailData
in interface ThumbnailManager
attachment
- the attachmentimageDimensions
- image dimensions of the thumbnailFileNotFoundException
- if the thumbnail file is not foundpublic com.atlassian.core.util.thumbnail.Thumbnail getThumbnail(@Nonnull Attachment attachment) throws IllegalArgumentException
getThumbnail
in interface ThumbnailManager
attachment
- the attachmentIllegalArgumentException
- if the attachment is an inappropriate type for thumbnailing, i.e. ThumbnailManager.isThumbnailable(Attachment)
returns falsepublic com.atlassian.core.util.thumbnail.Thumbnail getThumbnail(@Nonnull Attachment attachment, @Nullable ImageDimensions imageDimensions) throws IllegalArgumentException
getThumbnail
in interface ThumbnailManager
attachment
- the attachmentimageDimensions
- image dimensions of the thumbnailIllegalArgumentException
- if the attachment is an inappropriate type for thumbnailing, i.e. ThumbnailManager.isThumbnailable(Attachment)
returns falsepublic ThumbnailInfo getThumbnailInfo(@Nonnull Attachment attachment) throws CannotGenerateThumbnailException
getThumbnailInfo
in interface ThumbnailManager
attachment
- the attachmentCannotGenerateThumbnailException
- if no thumbnail information can be generated for this thumbnailpublic ThumbnailInfo getThumbnailInfo(@Nonnull Attachment attachment, @Nullable ImageDimensions imageDimensions) throws CannotGenerateThumbnailException
getThumbnailInfo
in interface ThumbnailManager
attachment
- the attachmentimageDimensions
- image dimensions of the thumbnailCannotGenerateThumbnailException
- if no thumbnail information can be generated for this thumbnailpublic ThumbnailInfo getThumbnailInfo(@Nonnull Attachment attachment, @Nullable String remoteAttachmentPath) throws CannotGenerateThumbnailException
getThumbnailInfo
in interface ThumbnailManager
attachment
- the attachmentremoteAttachmentPath
- 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 thumbnailpublic ThumbnailInfo getThumbnailInfo(@Nonnull Attachment attachment, @Nullable String remoteAttachmentPath, @Nullable ImageDimensions imageDimensions) throws CannotGenerateThumbnailException
getThumbnailInfo
in interface ThumbnailManager
attachment
- the attachmentremoteAttachmentPath
- 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 thumbnailpublic void setBootstrapManager(BootstrapManager bootstrapManager)
@Deprecated public Collection<com.atlassian.core.util.thumbnail.Thumbnail> getThumbnails(Collection<Attachment> attachments) throws Exception
getThumbnails
in interface ThumbnailManager
Exception
protected File getThumbnailsFolder(Attachment attachment)
public File getThumbnailFile(@Nonnull Attachment attachment)
getThumbnailFile
in interface ThumbnailManager
attachment
- the attachmentpublic File getThumbnailFile(@Nonnull Attachment attachment, @Nullable ImageDimensions imageDimensions)
getThumbnailFile
in interface ThumbnailManager
attachment
- the attachmentimageDimensions
- image dimensions of the thumbnailpublic File getThumbnailFile(long attachmentId, int version, long contentId)
getThumbnailFile
in interface ThumbnailManager
public boolean removeThumbnail(@Nonnull Attachment attachment)
removeThumbnail
in interface ThumbnailManager
attachment
- the attachment@Deprecated public com.atlassian.core.util.thumbnail.Thumber getThumber()
@Deprecated public DelegatingThumbnailRenderer getThumbnailRenderer()
public void setThumbnailRenderer(DelegatingThumbnailRenderer thumbnailRenderer)
public void setSettingsManager(SettingsManager settingsManager)
public void setImageDetailsManager(ImageDetailsManager imageDetailsManager)
Copyright © 2003–2017 Atlassian. All rights reserved.