com.atlassian.confluence.pages.thumbnail
Class AbstractThumbnailManager

java.lang.Object
  extended bycom.atlassian.confluence.pages.thumbnail.AbstractThumbnailManager
All Implemented Interfaces:
ThumbnailManager
Direct Known Subclasses:
WebDavThumbnailManager

public class AbstractThumbnailManager
extends Object
implements ThumbnailManager


Field Summary
protected  org.apache.log4j.Category log
           
protected  Thumber thumber
           
 
Fields inherited from interface com.atlassian.confluence.pages.thumbnail.ThumbnailManager
THUMBNAIL_PATH_SUFFIX
 
Constructor Summary
AbstractThumbnailManager()
           
 
Method Summary
 boolean checkToolkit()
          checks whether the users system has AWT toolkit required to create thumbnails
 int getMaxHeight()
           
 int getMaxWidth()
           
 Thumber getThumber()
           
 Thumbnail getThumbnail(Attachment attachment)
          Retrieves the thumbnail for attachment
 InputStream getThumbnailData(Attachment attachment)
          We only store a thumbnail of the latest version of an image attachment in the format thumb_foo.jpg When new versions of the attachment are added, this thumbnail is removed and regenerated the next time its requested.
 File getThumbnailFile(Attachment attachment)
          returns the path to the thumbnail for this attachment
 Collection getThumbnails(Collection attachments)
          not currently used
protected  File getThumbnailsFolder(Attachment attachment)
           
 boolean isThumbnailable(Attachment attachment)
          checks the mime type of the attachment to determine whether a thumbnail can be created from it
 void setAttachmentManager(AttachmentManager attachmentManager)
           
 void setBootstrapManager(BootstrapManager bootstrapManager)
           
 void setSettingsManager(SettingsManager settingsManager)
           
 void setThumber(Thumber thumber)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.log4j.Category log

thumber

protected Thumber thumber
Constructor Detail

AbstractThumbnailManager

public AbstractThumbnailManager()
Method Detail

isThumbnailable

public boolean isThumbnailable(Attachment attachment)
Description copied from interface: ThumbnailManager
checks the mime type of the attachment to determine whether a thumbnail can be created from it

Specified by:
isThumbnailable in interface ThumbnailManager
Parameters:
attachment -
Returns:

checkToolkit

public boolean checkToolkit()
Description copied from interface: ThumbnailManager
checks whether the users system has AWT toolkit required to create thumbnails

Specified by:
checkToolkit in interface ThumbnailManager
Returns:

getThumbnailData

public InputStream getThumbnailData(Attachment attachment)
                             throws FileNotFoundException
We only store a thumbnail of the latest version of an image attachment in the format thumb_foo.jpg When new versions of the attachment are added, this thumbnail is removed and regenerated the next time its requested.

Specified by:
getThumbnailData in interface ThumbnailManager
Parameters:
attachment -
Returns:
Throws:
FileNotFoundException - NOTE: Dodgy, but this function assumes that the thumbnail has been created i.e getThumbnail has been called.

getThumbnail

public Thumbnail getThumbnail(Attachment attachment)
                       throws MalformedURLException,
                              FileNotFoundException
Retrieves the thumbnail for attachment

Specified by:
getThumbnail in interface ThumbnailManager
Parameters:
attachment - the Attachment the thumbnail belongs to
Returns:
a Thumbnail representing the image
Throws:
MalformedURLException
FileNotFoundException
IllegalArgumentException - if a thumbnail cannot be created from attachment

setBootstrapManager

public void setBootstrapManager(BootstrapManager bootstrapManager)

getThumbnails

public Collection getThumbnails(Collection attachments)
                         throws Exception
not currently used

Specified by:
getThumbnails in interface ThumbnailManager
Parameters:
attachments -
Returns:
Throws:
Exception

getThumbnailsFolder

protected File getThumbnailsFolder(Attachment attachment)

getThumbnailFile

public File getThumbnailFile(Attachment attachment)
Description copied from interface: ThumbnailManager
returns the path to the thumbnail for this attachment

Specified by:
getThumbnailFile in interface ThumbnailManager
Parameters:
attachment -
Returns:

getMaxHeight

public int getMaxHeight()
Specified by:
getMaxHeight in interface ThumbnailManager
Returns:
the maximum height of the generated thumbnail

getMaxWidth

public int getMaxWidth()
Specified by:
getMaxWidth in interface ThumbnailManager
Returns:
the maximum width of the generated thumbnail

getThumber

public Thumber getThumber()

setThumber

public void setThumber(Thumber thumber)

setSettingsManager

public void setSettingsManager(SettingsManager settingsManager)

setAttachmentManager

public void setAttachmentManager(AttachmentManager attachmentManager)


Confluence is developed by Atlassian.