com.atlassian.confluence.pages
Class AttachmentUtils

java.lang.Object
  extended by 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


Constructor Summary
AttachmentUtils()
           
 
Method Summary
static String getConfluenceAttachmentDirectory()
           
static File getContainingFolder(Attachment attachment)
          Deprecated. since 3.1 this method returns an incorrect path. Use HierarchicalFileSystemAttachmentDataDao.getDirectoryForAttachmentContainer(long, long)
static InputStream getLatestAttachmentStream(Attachment attachment)
          Returns the attachment data as an InputStream

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

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachmentUtils

public AttachmentUtils()
Method Detail

getContainingFolder

@Deprecated
public static File getContainingFolder(Attachment attachment)
Deprecated. since 3.1 this method returns an incorrect path. Use HierarchicalFileSystemAttachmentDataDao.getDirectoryForAttachmentContainer(long, long)

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()


Copyright © 2003-2013 Atlassian. All Rights Reserved.