com.atlassian.confluence.pages.persistence.dao.AttachmentDao |
Known Indirect Subclasses |
This interface defines the methods for classes acting as a DAO at the level of meta-data storage for Attachments.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AttachmentDao.AttachmentCopier | |||||||||||
AttachmentDao.AttachmentMigrator |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Perform any tasks necessary after Attachment data has been moved from
this data store to another.
| |||||||||||
Retrieves the latest versions of all Attachments
Use of this method is discouraged when there are a
large amount of Attachments.
| |||||||||||
Retrieves the latest versions of all Attachments and returns an
Iterator to the results.
| |||||||||||
Return the attachment on the specified content with the given filename and version.
| |||||||||||
Retrieves the InputStream representing the data for attachment
| |||||||||||
Returns the attachment with the given persistent ID.
| |||||||||||
Get a copier object to copy attachments between data stores
The source data store will remain untouched
| |||||||||||
Retrieves all the last added versions for each user who has added a version of the attachment
That is, if a user has added multiple versions, only the latest added version will be added to the list returned.
| |||||||||||
Return the latest version of the attachment on the specified content with the given filename.
| |||||||||||
Retrieves the latest versions of all attachments to ceo
| |||||||||||
Get a migrator object to migrate attachments between attachment datastores.
| |||||||||||
Moves an Attachment to a new file name or content object
This method assumes that the filename and/or content of the attachment
(and its previous versions) have already been updated.
| |||||||||||
Prepare the data store for a migration from another type of data store.
| |||||||||||
Removes attachment (and all of its versions)
| |||||||||||
Sets the attachment data for attachment
This method will overwrite any existing data for
the attachment version.
| |||||||||||
Saves a new attachment
| |||||||||||
Saves a new version of attachment
|
Perform any tasks necessary after Attachment data has been moved from this data store to another. These tasks may assume that users are locked out of the system.
RuntimeException | if there was a problem |
---|
content | the content object |
---|
Retrieves the latest versions of all Attachments Use of this method is discouraged when there are a large amount of Attachments.
Retrieves the latest versions of all Attachments and returns an Iterator to the results.
Return the attachment on the specified content with the given filename and version. Returns null if no such attachment exists.
Note: unlikegetAttachment(ContentEntityObject, String, int)
, this method does not accept zero as a special
flag to indicate the latest version of an attachment. To retrieve the latest version
of an attachment, use getLatestAttachment(ContentEntityObject, String)
.content | the content to find the attachment on |
---|---|
fileName | the file name of the attachment, treated case-insensitively |
version | the version of the attachment |
IllegalArgumentException | if the content or fileName is null |
---|
Retrieves the InputStream representing the data for attachment
attachment | the attachment whose data will be returned |
---|
AttachmentDataNotFoundException | if the data could not be found |
---|
Returns the attachment with the given persistent ID. Returns null if no such attachment exists.
id | the persistent ID of the attachment to retrieve |
---|
Get a copier object to copy attachments between data stores The source data store will remain untouched
destinationDao | dao to copy attachments to |
---|
Retrieves all the last added versions for each user who has added a version of the attachment That is, if a user has added multiple versions, only the latest added version will be added to the list returned. Result will be sorted with the earliest version coming first.
attachment | attachment (must be the latest version) |
---|
IllegalArgumentException | if the attachment is not the latest version or null |
---|
Return the latest version of the attachment on the specified content with the given filename. Returns null if no attachment with that name on the content exists.
content | the content to find the attachment on |
---|---|
fileName | the file name of the attachment |
IllegalArgumentException | if the content or fileName is null |
---|
Retrieves the latest versions of all attachments to ceo
ceo | the content to look up attachments |
---|
Get a migrator object to migrate attachments between attachment datastores. To be used when switching datastore implementations
destinationDao | dao to move attachments to |
---|
Moves an Attachment to a new file name or content object
This method assumes that the filename and/or content of the attachment (and its previous versions) have already been updated.attachment | the Attachment to be moved |
---|---|
oldAttachment | the Attachment before it has been updated |
newContent | the new content attachment belongs to |
IllegalArgumentException | if attachment is not the latest version |
---|
Prepare the data store for a migration from another type of data store.
Classes implementing this method will perform any tasks necessary to allow the data store to be used. These tasks may assume that users are locked out of the system.RuntimeException | if there was a problem |
---|
Removes attachment (and all of its versions)
attachment | the Attachment to be removed |
---|
Sets the attachment data for attachment This method will overwrite any existing data for the attachment version.
attachment | Attachment the data belongs to |
---|---|
attachmentData | the data to save |
Saves a new attachment
attachment | the Attachment to be saved |
---|---|
attachmentData | the attachment data to be saved |
Saves a new version of attachment
attachment | the Attachment to be saved |
---|---|
previousVersion | the previous version of the Attachment |
attachmentData | the attachment data to be saved |