com.atlassian.confluence.pages.thumbnail
Interface ThumbnailManager

All Known Implementing Classes:
DefaultThumbnailManager

public interface ThumbnailManager


Field Summary
static java.lang.String THUMBNAIL_PATH_SUFFIX
           
 
Method Summary
 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.
 java.io.InputStream getThumbnailData(Attachment attachment)
          retrieves the thumbnail data (as a stream) from where it was stored in the file system
 java.io.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, java.lang.String rootAttachmentPath)
          Return the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk.
 java.util.Collection<com.atlassian.core.util.thumbnail.Thumbnail> getThumbnails(java.util.Collection<Attachment> attachments)
          Deprecated. since 5.4. No replacement.
 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(java.io.InputStream imageData)
          Deprecated. since 5.4.
 boolean isThumbnailable(ThumbnailInfo info)
           
 boolean removeThumbnail(Attachment attachment)
          Removes the thumbnail for the specified attachment.
 

Field Detail

THUMBNAIL_PATH_SUFFIX

static final java.lang.String THUMBNAIL_PATH_SUFFIX
Method Detail

getThumbnails

@Deprecated
java.util.Collection<com.atlassian.core.util.thumbnail.Thumbnail> getThumbnails(java.util.Collection<Attachment> attachments)
                                                                                throws java.lang.Exception
Deprecated. since 5.4. No replacement.

Throws:
java.lang.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


getThumbnailData

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

Throws:
java.io.FileNotFoundException

getThumbnailFile

java.io.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 java.lang.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:
java.lang.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,
                               java.lang.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.

isThumbnailable

boolean isThumbnailable(ThumbnailInfo info)

isThumbnailable

@Deprecated
boolean isThumbnailable(java.io.InputStream imageData)
Deprecated. since 5.4.



Copyright © 2003-2014 Atlassian. All Rights Reserved.