java.lang.Object | |
↳ | com.atlassian.confluence.pages.persistence.dao.WebDavAttachmentDao |
This class is deprecated.
since 2.7 WebDav attachment storage is no longer supported
Legacy AttachmentDAO implementation for a WebDAV backend only maintained in the codebase for the purpose of upgrading *from* WebDAV.
This class handles authentication and communication with a WebDAV server when it is being used for Attachment storage.
This implementation is different to the default (AbstractHibernateAttachmentDao), as it does not store the Attachment data in the Hibernate-managed Confluence database. Instead, we construct the Attachment information from the properties stored by the WebDAV server. While this may result in decreased performance, it allows the WebDAV server to be accessed independently of Confluence and attachments changes to be reflected in Confluence.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
The contents of the WebDAV store may be used by other applications
or users, so we do not clean it out after migrating away from it.
| |||||||||||
Retrieves the latest versions of all Attachments
Use of this method is discouraged when there are a
large amount of Attachments.
| |||||||||||
This implementation is technically dodgy.
| |||||||||||
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.
| |||||||||||
This method is not supported by the implementation.
| |||||||||||
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
| |||||||||||
This method is not supported by the implementation.
| |||||||||||
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.
| |||||||||||
In this implementation, there may be existing files on the
WebDAV store, so no deletion will occur.
| |||||||||||
todo: Should i remove the files from the webdav server?! should i remove the parent folder when folder's empty?
| |||||||||||
Technically, this method is supposed to overwrite existing data
without incrementing the version, due to the nature of WebDAV,
we can't avoid that.
| |||||||||||
This implementation saves a new Attachment to the appropriate path.
| |||||||||||
Saves a new version of attachment
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.atlassian.confluence.pages.persistence.dao.AttachmentDao
|
The contents of the WebDAV store may be used by other applications or users, so we do not clean it out after migrating away from it.
Retrieves the latest versions of all Attachments Use of this method is discouraged when there are a large amount of Attachments.
This implementation is technically dodgy. In other (Hibernate) implementations, we get an iterator of the results from the database, so we don't have to load all of the attachments into memory at the same time.
However, due to the nature of WebDAV (and the fact that we don't have a store for Attachment meta-data internal to Confluence), we can't do that, so just return an Iterator over the results of #findAll.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 |
Retrieves the InputStream representing the data for attachment
attachment | the attachment whose data will be returned |
---|
Returns the attachment with the given persistent ID. Returns null if no such attachment exists.
id | the persistent ID of the attachment to retrieve |
---|
This method is not supported by the implementation.
destinationDao | the destination AttachmentDAO |
---|
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) |
---|
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 |
Retrieves the latest versions of all attachments to ceo
ceo | the content to look up attachments |
---|
This method is not supported by the implementation.
destinationDao | the destination AttachmentDAO |
---|
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 |
In this implementation, there may be existing files on the WebDAV store, so no deletion will occur. However, existing files will be overwritten.
todo: Should i remove the files from the webdav server?! should i remove the parent folder when folder's empty?
attachment | the Attachment to be removed |
---|
Technically, this method is supposed to overwrite existing data without incrementing the version, due to the nature of WebDAV, we can't avoid that.
attachment | the Attachment to replace the data |
---|---|
attachmentData | the data to write |
This implementation saves a new Attachment to the appropriate path.
It also removes the ContentEntityObject from the Attachment, in order to prevent cascade problems with Hibernate trying to store the Attachment and the CEO.attachment | the Attachment to save |
---|---|
attachmentData | the data to save for the Attachment |
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 |