com.atlassian.confluence.pages
Class AttachmentUtils

java.lang.Object
  extended by com.atlassian.confluence.pages.AttachmentUtils

public class AttachmentUtils
extends java.lang.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
           
 
Constructor Summary
AttachmentUtils()
           
 
Method Summary
static java.lang.String getConfluenceAttachmentDirectory()
           
static java.io.File getContainingFolder(Attachment attachment)
           
static java.io.InputStream getLatestAttachmentStream(Attachment attachment)
          Returns the attachment data as an InputStream

This method is not specific to any implementation of the AttachmentManager.

static java.io.File getOldContainingFolder(Attachment attachment)
          Deprecated. as of Confluence 2.2 (we now use the attachment id to store attachments)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.log4j.Category log
Constructor Detail

AttachmentUtils

public AttachmentUtils()
Method Detail

getOldContainingFolder

public static java.io.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 java.io.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 java.io.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:
java.lang.IllegalStateException - if the AttachmentManager could not be retrieved from the application context

getConfluenceAttachmentDirectory

public static java.lang.String getConfluenceAttachmentDirectory()


Copyright © 2003-2008 Atlassian Pty Ltd. All Rights Reserved.