public class

AttachmentUtils

extends Object
java.lang.Object
   ↳ com.atlassian.confluence.pages.AttachmentUtils

Class Overview

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

Summary

Public Constructors
AttachmentUtils()
Public Methods
static String getConfluenceAttachmentDirectory()
static File getContainingFolder(Attachment attachment)
This method is deprecated. since 3.1 this method returns an incorrect path. Use 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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public AttachmentUtils ()

Public Methods

public static String getConfluenceAttachmentDirectory ()

public static File getContainingFolder (Attachment attachment)

This method is deprecated.
since 3.1 this method returns an incorrect path. Use getDirectoryForAttachmentContainer(long, long)

Returns
  • returns containing folder of attachment (that are stored on the filesystem using their attachment ids)

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