|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AttachmentManager
| Method Summary | |
|---|---|
java.util.List |
getAllVersions(Attachment attachment)
Get all versions of an attachment, starting with the current version |
Attachment |
getAttachment(ContentEntityObject content,
java.lang.String attachmentFileName)
Get the most recent version of an attachment with a given name for a particular page |
Attachment |
getAttachment(ContentEntityObject content,
java.lang.String attachmentFileName,
int version)
Retrieve a named attachment from a page |
AttachmentDao |
getAttachmentDao()
Retrieves the AttachmentDao for the AttachmentManager |
java.io.InputStream |
getAttachmentData(Attachment attachment)
Retrieve the data for attachment |
java.util.List |
getAttachments(ContentEntityObject content)
Returns a list of all attachments, old and new. |
java.util.List |
getAttachments(ListQuery query,
int firstResult)
Deprecated. since 2.8, use com.atlassian.confluence.search.smartlist.SmartListManager#search instead. |
AttachmentDao.AttachmentCopier |
getCopier(AttachmentManager destination)
Retrieves a AttachmentDao.AttachmentCopier that will allow the attachments from one data store to be copied across to another. |
java.util.List<Attachment> |
getLatestVersionsOfAttachments(ContentEntityObject content)
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. |
java.util.List |
getPreviousVersions(Attachment attachment)
Get all non-current versions of an attachment, not including the current version. |
void |
moveAttachment(Attachment latestVersion,
java.lang.String fileName,
ContentEntityObject newContent)
|
void |
removeAttachmentFromServer(Attachment attachment)
Removes an Attachment and its data from the server and data store |
void |
removeAttachments(java.util.List attachments)
Removes the contents of attachments from the server |
void |
saveAttachment(Attachment attachment,
Attachment previousVersion,
java.io.InputStream attachmentData)
Saves an Attachment and its data |
void |
setAttachmentData(Attachment attachment,
java.io.InputStream attachmentData)
Set the data belonging to attachment This method can be used when there is missing data for an Attachment (e.g. |
| Method Detail |
|---|
java.util.List getAttachments(ContentEntityObject content)
java.util.List getAttachments(ListQuery query,
int firstResult)
java.util.List<Attachment> getLatestVersionsOfAttachments(ContentEntityObject content)
java.io.InputStream getAttachmentData(Attachment attachment)
attachment - the Attachment the data belongs to
java.lang.RuntimeException - if the data could not be foundvoid removeAttachmentFromServer(Attachment attachment)
attachment - the Attachment to removevoid removeAttachments(java.util.List attachments)
attachments - a List of AttachmentsremoveAttachmentFromServer(Attachment)
void moveAttachment(Attachment latestVersion,
java.lang.String fileName,
ContentEntityObject newContent)
latestVersion - The attachment to be movedfileName - New name of the filenewContent - The new contentEntiityObject which will be parent to the attachment
Attachment getAttachment(ContentEntityObject content,
java.lang.String attachmentFileName,
int version)
content - the page the attachment is attached toattachmentFileName - the filename of the attachment to retrieveversion - the version of the attachment to retrieve. If you provide a version of 0
or less, you'll get the most recent version, but you should probably use
#getAttachment(AbstractPage, String) instead for that purpose instead
Attachment getAttachment(ContentEntityObject content,
java.lang.String attachmentFileName)
content - the page the attachment is attached toattachmentFileName - the filename of the attachment to be retrieved
void saveAttachment(Attachment attachment,
Attachment previousVersion,
java.io.InputStream attachmentData)
throws java.io.IOException
attachment - the modified version of the AttachmentpreviousVersion - the original version of the Attachment (null if new)attachmentData - an InputStream representing the data of the Attachment
java.io.IOException
java.lang.IllegalArgumentException - if attachment's content is not set
void setAttachmentData(Attachment attachment,
java.io.InputStream attachmentData)
throws AttachmentDataExistsException
attachment - Attachment the data belongs toattachmentData - the data to be saved
AttachmentDataExistsException - if data for attachment already existsAttachmentDao.AttachmentMigrator getMigrator(AttachmentManager destination)
destination - the AttachmentManager the data is being moved to
AttachmentDao.AttachmentCopier getCopier(AttachmentManager destination)
destination - the AttachmentManager the data is being copied to
AttachmentDao getAttachmentDao()
java.util.List getAllVersions(Attachment attachment)
java.util.List getPreviousVersions(Attachment attachment)
attachment - the attachment to get all non-current versions for.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||