Class DefaultThumbnailManager
java.lang.Object
com.atlassian.confluence.pages.thumbnail.DefaultThumbnailManager
- All Implemented Interfaces:
- ThumbnailManagerInternal,- ThumbnailManager
- 
Field SummaryFields inherited from interface com.atlassian.confluence.pages.thumbnail.ThumbnailManagerTHUMBNAIL_IMAGE_DARK_FEATURE, THUMBNAIL_PATH_SUFFIXFields inherited from interface com.atlassian.confluence.impl.pages.thumbnail.ThumbnailManagerInternalTHUMBNAIL_DIR_NAME
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncom.atlassian.core.util.thumbnail.ThumbnailgetThumbnail(@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.ThumbnailgetThumbnail(@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.getThumbnailData(@NonNull Attachment attachment) Retrieves the thumbnail data (as a stream) of the latest version from where it was stored in the file system.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.getThumbnailInfo(@NonNull Attachment attachment) Return the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk.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.getThumbnailInfo(@NonNull Attachment attachment, @Nullable String remoteAttachmentPath) Return the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk.getThumbnailInfo(@NonNull Attachment attachment, @Nullable String remoteAttachmentPath, @Nullable ImageDimensions imageDimensions) Return the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk.com.atlassian.dc.filestore.api.compat.FilesystemPathgetThumbnailPath(long attachmentId, int version, long contentId) com.atlassian.dc.filestore.api.compat.FilesystemPathgetThumbnailPath(@NonNull Attachment attachment, @Nullable ImageDimensions imageDimensions) protected FilegetThumbnailsFolder(Attachment attachment) Deprecated.since 7.14booleanisThumbnailable(@Nullable Attachment attachment) Checks the content type/mime type of the attachment to determine whether a thumbnail can be created from itbooleanisThumbnailable(@NonNull ThumbnailInfo info) Check the thumbnail information to determine whether a thumbnail can be created from itbooleanremoveThumbnail(@NonNull Attachment attachment) Removes the thumbnail for the specified attachmentvoidsetBootstrapManager(BootstrapManager bootstrapManager) voidsetConfluenceHome(com.atlassian.dc.filestore.api.compat.FilesystemPath confluenceHome) voidsetImageDetailsManager(ImageDetailsManager imageDetailsManager) voidsetSettingsManager(GlobalSettingsManager settingsManager) voidsetSettingsManager(SettingsManager settingsManager) Deprecated.since 7.20 UsesetSettingsManager(GlobalSettingsManager)voidsetThumbnailRenderer(DelegatingThumbnailRenderer thumbnailRenderer) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.confluence.impl.pages.thumbnail.ThumbnailManagerInternalgetThumbnailFile, getThumbnailFile, getThumbnailFile
- 
Constructor Details- 
DefaultThumbnailManagerpublic DefaultThumbnailManager()
 
- 
- 
Method Details- 
isThumbnailableDescription copied from interface:ThumbnailManagerChecks the content type/mime type of the attachment to determine whether a thumbnail can be created from it- Specified by:
- isThumbnailablein interface- ThumbnailManager
- Parameters:
- attachment- the attachment
- Returns:
- true if the attachment can have thumbnail, otherwise false
 
- 
isThumbnailableDescription copied from interface:ThumbnailManagerCheck the thumbnail information to determine whether a thumbnail can be created from it- Specified by:
- isThumbnailablein interface- ThumbnailManager
- Parameters:
- info- the thumbnail information
- Returns:
- true if it can have thumbnail, otherwise false
 
- 
getThumbnailDataDescription copied from interface:ThumbnailManagerRetrieves the thumbnail data (as a stream) of the latest version from where it was stored in the file system. This function assumes that the thumbnail has been created i.e getThumbnail has been called.- Specified by:
- getThumbnailDatain interface- ThumbnailManager
- Parameters:
- attachment- the attachment
- Returns:
- the input stream of the thumbnail
- Throws:
- FileNotFoundException- if the thumbnail file is not found
 
- 
getThumbnailDatapublic InputStream getThumbnailData(@NonNull Attachment attachment, @Nullable ImageDimensions imageDimensions) throws FileNotFoundException Description copied from interface:ThumbnailManagerRetrieves the thumbnail data (as a stream) of the latest version from where it was stored in the file system. This function assumes that the thumbnail has been created. i.e getThumbnail has been called.- Specified by:
- getThumbnailDatain interface- ThumbnailManager
- Parameters:
- attachment- the attachment
- imageDimensions- image dimensions of the thumbnail
- Returns:
- the input stream of the thumbnail
- Throws:
- FileNotFoundException- if the thumbnail file is not found
 
- 
getThumbnailpublic com.atlassian.core.util.thumbnail.Thumbnail getThumbnail(@NonNull Attachment attachment) throws IllegalArgumentException Description copied from interface:ThumbnailManagerReturns a thumbnail for this attachment having ensured the thumbnail exists in the filesystem, generating it only if it doesn't already exist. The size of the thumbnail is set by the application's configuration.- Specified by:
- getThumbnailin interface- ThumbnailManager
- Parameters:
- attachment- the attachment
- Returns:
- the thumbnail if the attachment
- Throws:
- IllegalArgumentException- if the attachment is an inappropriate type for thumbnailing, i.e.- ThumbnailManager.isThumbnailable(Attachment)returns false
 
- 
getThumbnailpublic com.atlassian.core.util.thumbnail.Thumbnail getThumbnail(@NonNull Attachment attachment, @Nullable ImageDimensions imageDimensions) throws IllegalArgumentException Description copied from interface:ThumbnailManagerReturns a thumbnail for this attachment having ensured the thumbnail exists in the filesystem, generating it only if it doesn't already exist. The size of the thumbnail is set in parameters, if it doesn't exist, then use the application's configuration.- Specified by:
- getThumbnailin interface- ThumbnailManager
- Parameters:
- attachment- the attachment
- imageDimensions- image dimensions of the thumbnail
- Returns:
- the thumbnail of the attachment
- Throws:
- IllegalArgumentException- if the attachment is an inappropriate type for thumbnailing, i.e.- ThumbnailManager.isThumbnailable(Attachment)returns false
 
- 
getThumbnailInfopublic ThumbnailInfo getThumbnailInfo(@NonNull Attachment attachment) throws CannotGenerateThumbnailException Description copied from interface:ThumbnailManagerReturn the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk. The address of the thumbnail will be rooted at the context path, rather than the base url. The thumbnail maximum size is taken from the global settings.- Specified by:
- getThumbnailInfoin interface- ThumbnailManager
- Parameters:
- attachment- the attachment
- Returns:
- the thumbnail information of the attachment, never null
- Throws:
- CannotGenerateThumbnailException- if no thumbnail information can be generated for this thumbnail
 
- 
getThumbnailInfopublic ThumbnailInfo getThumbnailInfo(@NonNull Attachment attachment, @Nullable ImageDimensions imageDimensions) throws CannotGenerateThumbnailException Description copied from interface:ThumbnailManagerReturn the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk. The address of the thumbnail will be rooted at the context path, rather than the base url. The thumbnail maximum size is set in parameters, if it doesn't exist, then taken from the global settings.- Specified by:
- getThumbnailInfoin interface- ThumbnailManager
- Parameters:
- attachment- the attachment
- imageDimensions- image dimensions of the thumbnail
- Returns:
- the thumbnail information of the attachment, never null
- Throws:
- CannotGenerateThumbnailException- if no thumbnail information can be generated for this thumbnail
 
- 
getThumbnailInfopublic ThumbnailInfo getThumbnailInfo(@NonNull Attachment attachment, @Nullable String remoteAttachmentPath) throws CannotGenerateThumbnailException Description copied from interface:ThumbnailManagerReturn the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk. The address of the thumbnail will be rooted at the context path, rather than the base url. The thumbnail maximum size is taken from the global settings.- Specified by:
- getThumbnailInfoin interface- ThumbnailManager
- Parameters:
- attachment- the attachment
- remoteAttachmentPath- path to the thumbnail, excepting the thumbnail itself. Eg the value returned by- ConfluenceRenderUtils.getAttachmentRemotePath(com.atlassian.confluence.pages.Attachment).
- Returns:
- the thumbnail information of the attachment, never null
- Throws:
- CannotGenerateThumbnailException- if no thumbnail information can be generated for this thumbnail
 
- 
getThumbnailInfopublic ThumbnailInfo getThumbnailInfo(@NonNull Attachment attachment, @Nullable String remoteAttachmentPath, @Nullable ImageDimensions imageDimensions) throws CannotGenerateThumbnailException Description copied from interface:ThumbnailManagerReturn the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk. The address of the thumbnail will be rooted at the context path, rather than the base url. The thumbnail maximum size is set in parameters, if it doesn't exist, then taken from the global settings.- Specified by:
- getThumbnailInfoin interface- ThumbnailManager
- Parameters:
- attachment- the attachment
- remoteAttachmentPath- 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 thumbnail
- Returns:
- thumbnail information for the attachment, never null
- Throws:
- CannotGenerateThumbnailException- if no thumbnail information can be generated for this thumbnail
 
- 
setBootstrapManager
- 
setConfluenceHomepublic void setConfluenceHome(com.atlassian.dc.filestore.api.compat.FilesystemPath confluenceHome) 
- 
getThumbnailsFolderDeprecated.since 7.14
- 
getThumbnailPathpublic com.atlassian.dc.filestore.api.compat.FilesystemPath getThumbnailPath(@NonNull Attachment attachment, @Nullable ImageDimensions imageDimensions) - Specified by:
- getThumbnailPathin interface- ThumbnailManagerInternal
 
- 
getThumbnailPathpublic com.atlassian.dc.filestore.api.compat.FilesystemPath getThumbnailPath(long attachmentId, int version, long contentId) - Specified by:
- getThumbnailPathin interface- ThumbnailManagerInternal
 
- 
removeThumbnailRemoves the thumbnail for the specified attachment- Specified by:
- removeThumbnailin interface- ThumbnailManager
- Parameters:
- attachment- the attachment
- Returns:
- true if the thumbnail was found and was successfully removed, false if no thumbnail was found or the thumbnail could not be removed
 
- 
setThumbnailRenderer
- 
setSettingsManagerDeprecated.since 7.20 UsesetSettingsManager(GlobalSettingsManager)
- 
setSettingsManager- Since:
- 7.20
 
- 
setImageDetailsManager
 
-