|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.confluence.pages.persistence.dao.WebDavAttachmentDao
@Deprecated public class WebDavAttachmentDao
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.atlassian.confluence.pages.persistence.dao.AttachmentDao |
|---|
AttachmentDao.AttachmentCopier, AttachmentDao.AttachmentMigrator |
| Constructor Summary | |
|---|---|
WebDavAttachmentDao()
Deprecated. |
|
| Method Summary | |
|---|---|
void |
afterMigrationFrom()
Deprecated. 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. |
int |
countLatestVersionsOfAttachments(ContentEntityObject ceo)
Deprecated. |
java.util.List<Attachment> |
findAll()
Deprecated. Retrieves the latest versions of all Attachments Use of this method is discouraged when there are a large amount of Attachments. |
java.util.List |
findAllVersions(Attachment attachment)
Deprecated. |
java.util.Iterator<Attachment> |
findLatestVersionsIterator()
Deprecated. This implementation is technically dodgy. |
Attachment |
getAttachment(ContentEntityObject content,
java.lang.String fileName,
int version)
Deprecated. Return the attachment on the specified content with the given filename and version. |
java.io.InputStream |
getAttachmentData(Attachment attachment)
Deprecated. Retrieves the InputStream representing the data for attachment |
AttachmentDataStorageType |
getBackingStorageType()
Deprecated. Returns the backing storage type. |
Attachment |
getById(long id)
Deprecated. Returns the attachment with the given persistent ID. |
AttachmentDao.AttachmentCopier |
getCopier(AttachmentDao destinationDao)
Deprecated. This method is not supported by the implementation. |
java.util.List<Attachment> |
getLastAddedVersionsOf(Attachment attachment)
Deprecated. 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. |
Attachment |
getLatestAttachment(ContentEntityObject content,
java.lang.String fileName)
Deprecated. Return the latest version of the attachment on the specified content with the given filename. |
java.util.List<Attachment> |
getLatestVersionsOfAttachments(ContentEntityObject ceo)
Deprecated. Retrieves the latest versions of all attachments to ceo |
AttachmentDao.AttachmentMigrator |
getMigrator(AttachmentDao destinationDao)
Deprecated. This method is not supported by the implementation. |
boolean |
isAttachmentPresent(Attachment attachment)
Deprecated. Check that an attachment exists |
void |
moveAttachment(Attachment attachment,
Attachment oldAttachment,
ContentEntityObject newContent)
Deprecated. 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. |
void |
prepareForMigrationTo()
Deprecated. In this implementation, there may be existing files on the WebDAV store, so no deletion will occur. |
void |
removeAttachmentFromServer(Attachment attachment)
Deprecated. todo: Should i remove the files from the webdav server?! should i remove the parent folder when folder's empty? |
void |
removeAttachmentVersionFromServer(Attachment attachment)
Deprecated. Removes an attachment version |
void |
renameAttachment(Attachment attachment,
java.lang.String newName)
Deprecated. |
void |
replaceAttachmentData(Attachment attachment,
java.io.InputStream attachmentData)
Deprecated. Technically, this method is supposed to overwrite existing data without incrementing the version, due to the nature of WebDAV, we can't avoid that. |
void |
saveNewAttachment(Attachment attachment,
java.io.InputStream attachmentData)
Deprecated. This implementation saves a new Attachment to the appropriate path. |
void |
saveNewAttachmentVersion(Attachment attachment,
Attachment previousVersion,
java.io.InputStream attachmentData)
Deprecated. Saves a new version of attachment |
void |
setConfig(WebDavConfiguration config)
Deprecated. |
void |
setContentEntityObjectDao(ContentEntityObjectDao contentEntityObjectDao)
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WebDavAttachmentDao()
| Method Detail |
|---|
public void setConfig(WebDavConfiguration config)
public java.util.List<Attachment> getLatestVersionsOfAttachments(ContentEntityObject ceo)
AttachmentDao
getLatestVersionsOfAttachments in interface AttachmentDaoceo - the content to look up attachments
AttachmentDao.countLatestVersionsOfAttachments(com.atlassian.confluence.core.ContentEntityObject)public int countLatestVersionsOfAttachments(ContentEntityObject ceo)
countLatestVersionsOfAttachments in interface AttachmentDaoceo - the content object
AttachmentDao.getLatestVersionsOfAttachments(com.atlassian.confluence.core.ContentEntityObject)public java.util.List<Attachment> findAll()
AttachmentDao
findAll in interface AttachmentDaoAttachmentDao.findLatestVersionsIterator()public java.util.Iterator<Attachment> findLatestVersionsIterator()
findLatestVersionsIterator in interface AttachmentDao
public java.io.InputStream getAttachmentData(Attachment attachment)
throws AttachmentDataNotFoundException
AttachmentDao
getAttachmentData in interface AttachmentDaoattachment - the attachment whose data will be returned
AttachmentDataNotFoundException - if the data could not be found
public void saveNewAttachment(Attachment attachment,
java.io.InputStream attachmentData)
saveNewAttachment in interface AttachmentDaoattachment - the Attachment to saveattachmentData - the data to save for the Attachment
public void saveNewAttachmentVersion(Attachment attachment,
Attachment previousVersion,
java.io.InputStream attachmentData)
AttachmentDao
saveNewAttachmentVersion in interface AttachmentDaoattachment - the Attachment to be savedpreviousVersion - the previous version of the AttachmentattachmentData - the attachment data to be savedpublic boolean isAttachmentPresent(Attachment attachment)
AttachmentDao
isAttachmentPresent in interface AttachmentDaoattachment - the Attachment to be checked
public void moveAttachment(Attachment attachment,
Attachment oldAttachment,
ContentEntityObject newContent)
AttachmentDao
moveAttachment in interface AttachmentDaoattachment - the Attachment to be movedoldAttachment - the Attachment before it has been updatednewContent - the new content attachment belongs topublic void removeAttachmentFromServer(Attachment attachment)
removeAttachmentFromServer in interface AttachmentDaoattachment - the Attachment to be removedpublic void removeAttachmentVersionFromServer(Attachment attachment)
AttachmentDao
removeAttachmentVersionFromServer in interface AttachmentDaoattachment - the Attachment version to be removed
public void replaceAttachmentData(Attachment attachment,
java.io.InputStream attachmentData)
replaceAttachmentData in interface AttachmentDaoattachment - the Attachment to replace the dataattachmentData - the data to writepublic AttachmentDao.AttachmentMigrator getMigrator(AttachmentDao destinationDao)
getMigrator in interface AttachmentDaodestinationDao - the destination AttachmentDAO
GeneralAttachmentMigratorpublic AttachmentDao.AttachmentCopier getCopier(AttachmentDao destinationDao)
getCopier in interface AttachmentDaodestinationDao - the destination AttachmentDAO
GeneralAttachmentCopierpublic void prepareForMigrationTo()
prepareForMigrationTo in interface AttachmentDaopublic void afterMigrationFrom()
afterMigrationFrom in interface AttachmentDao
public void renameAttachment(Attachment attachment,
java.lang.String newName)
throws java.io.IOException
java.io.IOExceptionpublic void setContentEntityObjectDao(ContentEntityObjectDao contentEntityObjectDao)
public java.util.List findAllVersions(Attachment attachment)
findAllVersions in interface AttachmentDao
public Attachment getAttachment(ContentEntityObject content,
java.lang.String fileName,
int version)
AttachmentDaoAttachmentManager.getAttachment(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 AttachmentDao.getLatestAttachment(ContentEntityObject, String).
getAttachment in interface AttachmentDaocontent - the content to find the attachment onfileName - the file name of the attachment, treated case-insensitivelyversion - the version of the attachment
public Attachment getLatestAttachment(ContentEntityObject content,
java.lang.String fileName)
AttachmentDao
getLatestAttachment in interface AttachmentDaocontent - the content to find the attachment onfileName - the file name of the attachment
public Attachment getById(long id)
AttachmentDao
getById in interface AttachmentDaoid - the persistent ID of the attachment to retrieve
public java.util.List<Attachment> getLastAddedVersionsOf(Attachment attachment)
AttachmentDao
getLastAddedVersionsOf in interface AttachmentDaoattachment - attachment (must be the latest version)
public AttachmentDataStorageType getBackingStorageType()
AttachmentDao
getBackingStorageType in interface AttachmentDaoAttachmentDataDao.getStorageType()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||