|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.confluence.pages.persistence.dao.FileSystemAttachmentDataDao
public class FileSystemAttachmentDataDao
Nested Class Summary | |
---|---|
static interface |
FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategy
|
Constructor Summary | |
---|---|
FileSystemAttachmentDataDao()
|
Method Summary | |
---|---|
void |
afterMigrationFrom()
In this implementation, we leave the filesystem as is, and don't remove the attachments that have just been moved to another data store. |
FileLocationResolver |
getAttachmentsDirResolver()
|
protected File |
getConfluenceAttachmentDirectory()
|
InputStream |
getDataForAttachment(Attachment attachment)
Grabs the AttachmentData object for an Attachment |
protected File |
getDirectoryForAttachment(ContentEntityObject content,
Attachment attachment)
Retrieves the location of the containing folder for an Attachment |
protected File |
getDirectoryForContent(ContentEntityObject content)
|
protected File |
getLatestAttachmentFile(Attachment attachment)
|
FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategy |
getNamingStrategy()
|
void |
moveAttachment(Attachment attachment,
Attachment oldAttachment,
ContentEntityObject newContent)
Moves an attachment to a new file name or content object |
void |
prepareForMigrationTo()
In this implementation, we want to make sure the attachments directory is empty, otherwise we will have attachments or files that don't belong. |
void |
removeDataForAttachment(Attachment attachment,
ContentEntityObject originalContent)
Removes all attachment data for an attachment |
void |
replaceDataForAttachment(Attachment attachment,
InputStream data)
Sets the data for attachment This method will overwrite any existing data for the attachment. |
void |
saveDataForAttachment(Attachment attachment,
InputStream data)
Saves data to the attachment data store |
protected void |
saveDataForAttachment(Attachment attachment,
InputStream data,
boolean overwrite)
Saves data to the file system |
void |
saveDataForAttachmentVersion(Attachment attachment,
Attachment previousVersion,
InputStream data)
Saves data to the attachment data store, for an attachment that has been updated. |
void |
setAttachmentsDirResolver(FileLocationResolver attachmentsDirResolver)
|
void |
setNamingStrategy(FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategy namingStrategy)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected FileLocationResolver attachmentsDirResolver
public static final FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategy NAMING_STRATEGY_ID
public static final FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategy NAMING_STRATEGY_FILE_NAME
Constructor Detail |
---|
public FileSystemAttachmentDataDao()
Method Detail |
---|
public FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategy getNamingStrategy()
public void setNamingStrategy(FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategy namingStrategy)
protected File getConfluenceAttachmentDirectory()
protected File getLatestAttachmentFile(Attachment attachment)
public InputStream getDataForAttachment(Attachment attachment) throws AttachmentDataNotFoundException
AttachmentDataDao
getDataForAttachment
in interface AttachmentDataDao
attachment
- the Attachment representing the data
AttachmentDataNotFoundException
- if no data was foundpublic void removeDataForAttachment(Attachment attachment, ContentEntityObject originalContent)
AttachmentDataDao
removeDataForAttachment
in interface AttachmentDataDao
attachment
- The attachment for which data should be removedoriginalContent
- The content the attachment belongs topublic void saveDataForAttachment(Attachment attachment, InputStream data)
AttachmentDataDao
saveDataForAttachment
in interface AttachmentDataDao
attachment
- the Attachment the data belongs todata
- the InputStream to be writtenpublic FileLocationResolver getAttachmentsDirResolver()
protected void saveDataForAttachment(Attachment attachment, InputStream data, boolean overwrite)
attachment
- the Attachment the data belongs todata
- the InputStream to be writtenoverwrite
-
IllegalArgumentException
- if attachment is null
IllegalArgumentException
- if data is nullpublic void saveDataForAttachmentVersion(Attachment attachment, Attachment previousVersion, InputStream data)
AttachmentDataDao
saveDataForAttachmentVersion
in interface AttachmentDataDao
attachment
- the new version of the attachmentpreviousVersion
- the previous version of the attachmentdata
- the InputStream representing the datapublic void replaceDataForAttachment(Attachment attachment, InputStream data)
AttachmentDataDao
replaceDataForAttachment
in interface AttachmentDataDao
attachment
- Attachment the data belongs todata
- the data to be savedpublic void moveAttachment(Attachment attachment, Attachment oldAttachment, ContentEntityObject newContent)
AttachmentDataDao
moveAttachment
in interface AttachmentDataDao
attachment
- the Attachment to be movedoldAttachment
- the original version of the attachmentnewContent
- the new content the Attachment belongs toprotected File getDirectoryForAttachment(ContentEntityObject content, Attachment attachment)
content
- the ContentEntityObject the Attachment belongs toattachment
-
protected File getDirectoryForContent(ContentEntityObject content)
public void prepareForMigrationTo()
prepareForMigrationTo
in interface AttachmentDataDao
public void afterMigrationFrom()
afterMigrationFrom
in interface AttachmentDataDao
public void setAttachmentsDirResolver(FileLocationResolver attachmentsDirResolver)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |