|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.pages.AbstractAttachmentManager com.atlassian.confluence.pages.DefaultAttachmentManager
Default implementation of AttachmentManager
. The storage location of attachments
is not defined, and is handled by the AttachmentDao.
Field Summary | |
protected org.apache.log4j.Category |
log
|
Constructor Summary | |
DefaultAttachmentManager()
|
Method Summary | |
List |
getAllVersions(Attachment attachment)
Get all versions of an attachment, starting with the current version |
AttachmentDao |
getAttachmentDao()
Retrieves the AttachmentDao for the AttachmentManager |
InputStream |
getAttachmentData(Attachment attachment)
Retrieve the data for attachment |
List |
getAttachments(ContentEntityObject content)
Returns a list of all attachments, old and new. |
List |
getAttachments(ListQuery query,
int firstResult)
|
AttachmentDao.AttachmentCopier |
getCopier(AttachmentManager destination)
Retrieves a AttachmentDao.AttachmentCopier that will allow the attachments from one data store to be copied across to another. |
List |
getLatestVersionsOfAttachments(ContentEntityObject content)
b Returns a list of only latest versions of attachments. |
AttachmentDao.AttachmentMigrator |
getMigrator(AttachmentManager destination)
Retrieves a AttachmentDao.AttachmentMigrator that will allow the attachments from one data store to be moved across to another. |
void |
moveAttachment(Attachment latestVersion,
String newFileName,
ContentEntityObject newContent)
|
void |
removeAttachmentFromServer(Attachment latestVersion)
Removes the attachment and all previous versions |
protected void |
saveNewAttachment(Attachment attachment,
InputStream attachmentData)
|
protected void |
saveNewAttachmentVersion(Attachment attachment,
Attachment previousVersion,
InputStream attachmentData)
|
void |
setAttachmentDao(AttachmentDao attachmentDao)
|
void |
setAttachmentData(Attachment attachment,
InputStream attachmentData)
Set the data belonging to attachment This method can be used when there is missing data for an Attachment (e.g. |
Methods inherited from class com.atlassian.confluence.pages.AbstractAttachmentManager |
getAttachment, getAttachment, getPreviousVersions, getThumbnailManager, removeAttachments, removeThumbnail, saveAttachment, setThumbnailManager |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected org.apache.log4j.Category log
Constructor Detail |
public DefaultAttachmentManager()
Method Detail |
public InputStream getAttachmentData(Attachment attachment)
AttachmentManager
attachment
- the Attachment the data belongs to
protected void saveNewAttachment(Attachment attachment, InputStream attachmentData) throws IOException
saveNewAttachment
in class AbstractAttachmentManager
IOException
protected void saveNewAttachmentVersion(Attachment attachment, Attachment previousVersion, InputStream attachmentData) throws IOException
saveNewAttachmentVersion
in class AbstractAttachmentManager
IOException
public List getLatestVersionsOfAttachments(ContentEntityObject content)
AttachmentManager
public List getAttachments(ContentEntityObject content)
AttachmentManager
public List getAttachments(ListQuery query, int firstResult)
public void removeAttachmentFromServer(Attachment latestVersion)
latestVersion
- latest version of the attachment to removepublic void moveAttachment(Attachment latestVersion, String newFileName, ContentEntityObject newContent)
latestVersion
- The attachment to be movednewFileName
- New name of the filenewContent
- The new contentEntiityObject which will be parent to the attachmentpublic void setAttachmentData(Attachment attachment, InputStream attachmentData) throws AttachmentDataExistsException
AttachmentManager
attachment
- Attachment the data belongs toattachmentData
- the data to be saved
AttachmentDataExistsException
- if data for attachment already existspublic AttachmentDao.AttachmentMigrator getMigrator(AttachmentManager destination)
AttachmentManager
destination
- the AttachmentManager the data is being moved to
public AttachmentDao.AttachmentCopier getCopier(AttachmentManager destination)
AttachmentManager
destination
- the AttachmentManager the data is being copied to
public AttachmentDao getAttachmentDao()
AttachmentManager
public List getAllVersions(Attachment attachment)
AttachmentManager
public void setAttachmentDao(AttachmentDao attachmentDao)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |