com.atlassian.confluence.pages
Class AttachmentUtils
java.lang.Object
com.atlassian.confluence.pages.AttachmentUtils
public class AttachmentUtils
- extends Object
All versions of attachments in confluence are stored under a folder labeled with the name with the name of the attachment.
Example:
foo.gif (directory)
|
`-- 1 (file)
|
`-- 2 (file)
The containing folder is the parent folder holding the versions of that attachment
Field Summary |
protected static org.apache.log4j.Category |
log
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static org.apache.log4j.Category log
AttachmentUtils
public AttachmentUtils()
getOldContainingFolder
public static File getOldContainingFolder(Attachment attachment)
- Deprecated. as of Confluence 2.2 (we now use the attachment id to store attachments)
- The containing folder is the parent folder holding the versions of that attachment
If folder does not exist, create it
- Parameters:
attachment
-
- Returns:
- a file representing the containing folder of the attachment
getContainingFolder
public static File getContainingFolder(Attachment attachment)
- Parameters:
attachment
-
- Returns:
- returns containing folder of attachment (that are stored on the filesystem using their attachment ids)
getLatestAttachmentStream
public static InputStream getLatestAttachmentStream(Attachment attachment)
- Returns the attachment data as an InputStream
This method is not specific to any implementation of the AttachmentManager.
- Parameters:
attachment
- the attachment the data should be retrieved for
- Returns:
- the InputStream from the AttachmentManager
- Throws:
IllegalStateException
- if the AttachmentManager could not be retrieved from the application context
getConfluenceAttachmentDirectory
public static String getConfluenceAttachmentDirectory()