|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.pages.thumbnail.DefaultThumbnailManager
public class DefaultThumbnailManager
Field Summary |
---|
Fields inherited from interface com.atlassian.confluence.pages.thumbnail.ThumbnailManager |
---|
THUMBNAIL_PATH_SUFFIX |
Constructor Summary | |
---|---|
DefaultThumbnailManager()
|
Method Summary | |
---|---|
boolean |
checkToolkit()
checks whether the users system has AWT toolkit required to create thumbnails |
int |
getMaxHeight()
|
int |
getMaxWidth()
|
com.atlassian.core.util.thumbnail.Thumber |
getThumber()
|
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)
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. |
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 remoteAttachmentPath)
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)
not currently used |
protected java.io.File |
getThumbnailsFolder(Attachment attachment)
|
boolean |
isThumbnailable(Attachment attachment)
Deprecated. since 3.0 This only checks the content type, not the mime type of the attachment itself. |
boolean |
isThumbnailable(java.io.InputStream imageData)
|
static boolean |
isThumbnailable(java.lang.String mimeType)
|
boolean |
isThumbnailable(ThumbnailInfo info)
|
boolean |
removeThumbnail(Attachment attachment)
Removes the thumbnail for the specified attachment. |
void |
setAttachmentManager(AttachmentManager attachmentManager)
|
void |
setBootstrapManager(BootstrapManager bootstrapManager)
|
void |
setImageDetailsManager(ImageDetailsManager imageDetailsManager)
|
void |
setSettingsManager(SettingsManager settingsManager)
|
void |
setThumber(com.atlassian.core.util.thumbnail.Thumber thumber)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultThumbnailManager()
Method Detail |
---|
public boolean isThumbnailable(Attachment attachment)
ThumbnailManager
isThumbnailable
in interface ThumbnailManager
public static boolean isThumbnailable(java.lang.String mimeType)
public boolean isThumbnailable(ThumbnailInfo info)
isThumbnailable
in interface ThumbnailManager
public boolean isThumbnailable(java.io.InputStream imageData)
isThumbnailable
in interface ThumbnailManager
public boolean checkToolkit()
ThumbnailManager
checkToolkit
in interface ThumbnailManager
public java.io.InputStream getThumbnailData(Attachment attachment) throws java.io.FileNotFoundException
getThumbnailData
in interface ThumbnailManager
java.io.FileNotFoundException
public com.atlassian.core.util.thumbnail.Thumbnail getThumbnail(Attachment attachment) throws java.lang.IllegalArgumentException
getThumbnail
in interface ThumbnailManager
java.lang.IllegalArgumentException
- if the attachment is an inappropriate type for thumbnailing, i.e.
ThumbnailManager.isThumbnailable(Attachment)
returns falsepublic ThumbnailInfo getThumbnailInfo(Attachment attachment) throws CannotGenerateThumbnailException
ThumbnailManager
getThumbnailInfo
in interface ThumbnailManager
CannotGenerateThumbnailException
- if no thumbnail information can be generated for this thumbnail.public ThumbnailInfo getThumbnailInfo(Attachment attachment, java.lang.String remoteAttachmentPath) throws CannotGenerateThumbnailException
ThumbnailManager
getThumbnailInfo
in interface ThumbnailManager
remoteAttachmentPath
- path to the thumbnail, excepting the thumbnail itself. Eg the value
returned by ConfluenceRenderUtils.getAttachmentRemotePath(com.atlassian.confluence.pages.Attachment)
.
CannotGenerateThumbnailException
- if no thumbnail information can be generated for this thumbnail.public void setBootstrapManager(BootstrapManager bootstrapManager)
public java.util.Collection<com.atlassian.core.util.thumbnail.Thumbnail> getThumbnails(java.util.Collection<Attachment> attachments) throws java.lang.Exception
getThumbnails
in interface ThumbnailManager
java.lang.Exception
protected java.io.File getThumbnailsFolder(Attachment attachment)
public java.io.File getThumbnailFile(Attachment attachment)
ThumbnailManager
getThumbnailFile
in interface ThumbnailManager
public boolean removeThumbnail(Attachment attachment)
ThumbnailManager
removeThumbnail
in interface ThumbnailManager
public int getMaxHeight()
getMaxHeight
in interface ThumbnailManager
ThumbnailManager.getThumbnail(Attachment)
and
ThumbnailManager.getThumbnailInfo(Attachment)
without providing dimensionspublic int getMaxWidth()
getMaxWidth
in interface ThumbnailManager
ThumbnailManager.getThumbnail(Attachment)
and
ThumbnailManager.getThumbnailInfo(Attachment)
without providing dimensionspublic com.atlassian.core.util.thumbnail.Thumber getThumber()
public void setThumber(com.atlassian.core.util.thumbnail.Thumber thumber)
public void setSettingsManager(SettingsManager settingsManager)
public void setAttachmentManager(AttachmentManager attachmentManager)
public void setImageDetailsManager(ImageDetailsManager imageDetailsManager)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |