public class

DefaultThumbnailManager

extends Object
implements ThumbnailManager
java.lang.Object
   ↳ com.atlassian.confluence.pages.thumbnail.DefaultThumbnailManager

Summary

[Expand]
Inherited Fields
From interface com.atlassian.confluence.pages.thumbnail.ThumbnailManager
Public Constructors
DefaultThumbnailManager()
Public Methods
@Deprecated boolean checkToolkit()
This method is deprecated. since 3.5 - not used
int getMaxHeight()
int getMaxWidth()
@Deprecated Thumber getThumber()
This method is deprecated. since 3.5
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)
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
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)
Return the details of a thumbnail for a given attachment without actually creating the thumbnail file on disk.
DelegatingThumbnailRenderer getThumbnailRenderer()
Collection<Thumbnail> getThumbnails(Collection<Attachment> attachments)
not currently used
static boolean isThumbnailable(String mimeType)
boolean isThumbnailable(Attachment attachment)
checks the content type/mime type of the attachment to determine whether a thumbnail can be created from it
@Deprecated boolean isThumbnailable(InputStream imageData)
This method is deprecated. since 3.5 - not used
boolean isThumbnailable(ThumbnailInfo info)
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)
Protected Methods
File getThumbnailsFolder(Attachment attachment)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.pages.thumbnail.ThumbnailManager

Public Constructors

public DefaultThumbnailManager ()

Public Methods

@Deprecated public boolean checkToolkit ()

This method is deprecated.
since 3.5 - not used

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

public int getMaxHeight ()

public int getMaxWidth ()

@Deprecated public Thumber getThumber ()

This method is deprecated.
since 3.5

public 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. The size of the thumbnail is set by the application's configuration.

public 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.

HACK: This function assumes that the thumbnail has been created i.e getThumbnail has been called.

public File getThumbnailFile (Attachment attachment)

returns the path to the thumbnail for this attachment

public ThumbnailInfo getThumbnailInfo (Attachment attachment, String remoteAttachmentPath)

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
remoteAttachmentPath path to the thumbnail, excepting the thumbnail itself. Eg the value returned by getAttachmentRemotePath(ContentEntityObject).
Returns
  • thumbnail information for the attachment, never null

public ThumbnailInfo getThumbnailInfo (Attachment attachment)

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

public DelegatingThumbnailRenderer getThumbnailRenderer ()

public Collection<Thumbnail> getThumbnails (Collection<Attachment> attachments)

not currently used

Throws
Exception

public static boolean isThumbnailable (String mimeType)

public boolean isThumbnailable (Attachment attachment)

checks the content type/mime type of the attachment to determine whether a thumbnail can be created from it

@Deprecated public boolean isThumbnailable (InputStream imageData)

This method is deprecated.
since 3.5 - not used

public boolean isThumbnailable (ThumbnailInfo info)

public 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.

public void setBootstrapManager (BootstrapManager bootstrapManager)

public void setImageDetailsManager (ImageDetailsManager imageDetailsManager)

public void setSettingsManager (SettingsManager settingsManager)

public void setThumbnailRenderer (DelegatingThumbnailRenderer thumbnailRenderer)

Protected Methods

protected File getThumbnailsFolder (Attachment attachment)