com.atlassian.confluence.pages.thumbnail
Interface ThumbnailManager

All Known Implementing Classes:
DefaultThumbnailManager

public interface ThumbnailManager


Field Summary
static String THUMBNAIL_PATH_SUFFIX
           
 
Method Summary
 boolean checkToolkit()
          Deprecated. since 3.5
 int getMaxHeight()
          Deprecated. since 3.1 because clients should use the result of getThumbnail(com.atlassian.confluence.pages.Attachment) or getThumbnailInfo(com.atlassian.confluence.pages.Attachment), or retrieve the size from SettingsManager.getGlobalSettings().
 int getMaxWidth()
          Deprecated. since 3.1 because clients should use the result of getThumbnail(com.atlassian.confluence.pages.Attachment) or getThumbnailInfo(com.atlassian.confluence.pages.Attachment), or retrieve the size from SettingsManager.getGlobalSettings().
 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.
 InputStream getThumbnailData(Attachment attachment)
          retrieves the thumbnail data (as a stream) from where it was stored in the file system
 File getThumbnailFile(Attachment attachment)
          returns the path to the thumbnail for this attachment
 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, String rootAttachmentPath)
          Return the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk.
 Collection<com.atlassian.core.util.thumbnail.Thumbnail> getThumbnails(Collection<Attachment> attachments)
           
 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)
           
 boolean isThumbnailable(ThumbnailInfo info)
           
 boolean removeThumbnail(Attachment attachment)
          Removes the thumbnail for the specified attachment.
 

Field Detail

THUMBNAIL_PATH_SUFFIX

static final String THUMBNAIL_PATH_SUFFIX
Method Detail

getThumbnails

Collection<com.atlassian.core.util.thumbnail.Thumbnail> getThumbnails(Collection<Attachment> attachments)
                                                                      throws Exception
Throws:
Exception

isThumbnailable

boolean isThumbnailable(Attachment attachment)
checks the content type/mime type of the attachment to determine whether a thumbnail can be created from it


checkToolkit

@Deprecated
boolean checkToolkit()
Deprecated. since 3.5

checks whether the users system has AWT toolkit required to create thumbnails


getThumbnailData

InputStream getThumbnailData(Attachment attachment)
                             throws FileNotFoundException
retrieves the thumbnail data (as a stream) from where it was stored in the file system

Throws:
FileNotFoundException

getThumbnailFile

File getThumbnailFile(Attachment attachment)
returns the path to the thumbnail for this attachment


removeThumbnail

boolean removeThumbnail(Attachment attachment)
Removes the thumbnail for the specified 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.

getThumbnail

com.atlassian.core.util.thumbnail.Thumbnail getThumbnail(Attachment attachment)
                                                         throws IllegalArgumentException
Returns 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.

Throws:
IllegalArgumentException - if the attachment is an inappropriate type for thumbnailing, i.e. isThumbnailable(Attachment) returns false

getThumbnailInfo

ThumbnailInfo getThumbnailInfo(Attachment attachment)
                               throws CannotGenerateThumbnailException
Return 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.

Returns:
thumbnail information for the attachment, never null
Throws:
CannotGenerateThumbnailException - if no thumbnail information can be generated for this thumbnail.

getThumbnailInfo

ThumbnailInfo getThumbnailInfo(Attachment attachment,
                               String rootAttachmentPath)
                               throws CannotGenerateThumbnailException
Return 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.

Parameters:
rootAttachmentPath - path to the thumbnail, excepting the thumbnail itself. Eg the value returned by ConfluenceRenderUtils.getAttachmentRemotePath(com.atlassian.confluence.pages.Attachment).
Returns:
thumbnail information for the attachment, never null
Throws:
CannotGenerateThumbnailException - if no thumbnail information can be generated for this thumbnail.

getMaxHeight

@Deprecated
int getMaxHeight()
Deprecated. since 3.1 because clients should use the result of getThumbnail(com.atlassian.confluence.pages.Attachment) or getThumbnailInfo(com.atlassian.confluence.pages.Attachment), or retrieve the size from SettingsManager.getGlobalSettings().

Returns:
the maximum height of thumbnails generated by getThumbnail(Attachment) and getThumbnailInfo(Attachment) without providing dimensions

getMaxWidth

@Deprecated
int getMaxWidth()
Deprecated. since 3.1 because clients should use the result of getThumbnail(com.atlassian.confluence.pages.Attachment) or getThumbnailInfo(com.atlassian.confluence.pages.Attachment), or retrieve the size from SettingsManager.getGlobalSettings().

Returns:
the maximum width of thumbnails generated by getThumbnail(Attachment) and getThumbnailInfo(Attachment) without providing dimensions

isThumbnailable

boolean isThumbnailable(ThumbnailInfo info)

isThumbnailable

boolean isThumbnailable(InputStream imageData)


Copyright © 2003-2013 Atlassian. All Rights Reserved.