Class FileSystemAttachmentDataDao
- java.lang.Object
- 
- com.atlassian.confluence.pages.persistence.dao.FileSystemAttachmentDataDao
 
- 
- All Implemented Interfaces:
- AttachmentDataDao,- NonTransactionalAttachmentDataDao
 
 @Deprecated public class FileSystemAttachmentDataDao extends Object implements NonTransactionalAttachmentDataDao Deprecated.Since 5.5 Usecom.atlassian.confluence.pages.persistence.dao.filesystem.FileSystemAttachmentDataDao
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceFileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategyDeprecated.
 - 
Field SummaryFields Modifier and Type Field Description protected FileLocationResolverattachmentsDirResolverDeprecated.static FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategyNAMING_STRATEGY_FILE_NAMEDeprecated.static FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategyNAMING_STRATEGY_IDDeprecated.
 - 
Constructor SummaryConstructors Constructor Description FileSystemAttachmentDataDao()Deprecated.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidafterMigrationFrom()Deprecated.In this implementation, we leave the filesystem as is, and don't remove the attachments that have just been moved to another data store.FileLocationResolvergetAttachmentsDirResolver()Deprecated.protected FilegetConfluenceAttachmentDirectory()Deprecated.InputStreamgetDataForAttachment(Attachment attachment)Deprecated.Grabs the AttachmentData object for an AttachmentAttachmentDataStreamgetDataForAttachment(Attachment attachment, AttachmentDataStreamType dataStreamType)Deprecated.Grabs the AttachmentData object for an AttachmentAttachmentDataStreamgetDataForAttachment(Attachment attachment, AttachmentDataStreamType dataStreamType, Optional<RangeRequest> range)Deprecated.Grabs the AttachmentData object for an Attachmentprotected FilegetDirectoryForAttachment(ContentEntityObject content, Attachment attachment)Deprecated.Retrieves the location of the containing folder for an Attachmentprotected FilegetDirectoryForContent(ContentEntityObject content)Deprecated.protected FilegetLatestAttachmentFile(Attachment attachment)Deprecated.FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategygetNamingStrategy()Deprecated.AttachmentDataStorageTypegetStorageType()Deprecated.Returns the storage type.booleanisAttachmentPresent(Attachment attachment)Deprecated.Check that an attachment existsvoidmoveAttachment(Attachment attachment, Attachment oldAttachment, ContentEntityObject newContent)Deprecated.Moves an attachment to a new file name or content objectvoidmoveDataForAttachmentVersion(Attachment sourceAttachmentVersion, Attachment targetAttachmentVersion)Deprecated.Moves the attachment data from oneAbstractVersionedEntityObject.getVersion()to the other.voidprepareForMigrationTo()Deprecated.In this implementation, we want to make sure the attachments directory is empty, otherwise we will have attachments or files that don't belong.voidremoveDataForAttachment(Attachment attachment, ContentEntityObject originalContent)Deprecated.Removes all attachment data for the given attachment.voidremoveDataForAttachmentVersion(Attachment attachment, ContentEntityObject originalContent)Deprecated.Removes the attachment data for the given attachment version.voidremoveDataForAttachmentVersion(Attachment attachment, ContentEntityObject originalContent, AttachmentDataStreamType dataStreamType)Deprecated.Removes the attachment data of the specific stream type for the given attachment version.voidreplaceDataForAttachment(Attachment attachment, AttachmentDataStream dataStream)Deprecated.Sets the data for attachmentvoidreplaceDataForAttachment(Attachment attachment, InputStream data)Deprecated.Sets the data for attachmentvoidsaveDataForAttachment(Attachment attachment, AttachmentDataStream dataStream)Deprecated.Saves data to the attachment data storevoidsaveDataForAttachment(Attachment attachment, InputStream data)Deprecated.Saves data to the attachment data storeprotected voidsaveDataForAttachment(Attachment attachment, InputStream data, boolean overwrite)Deprecated.Saves data to the file systemvoidsaveDataForAttachmentVersion(Attachment attachment, Attachment previousVersion, AttachmentDataStream dataStream)Deprecated.Saves data to the attachment data store, for an attachment that has been updated.voidsaveDataForAttachmentVersion(Attachment attachment, Attachment previousVersion, InputStream data)Deprecated.Saves data to the attachment data store, for an attachment that has been updated.voidsetAttachmentsDirResolver(FileLocationResolver attachmentsDirResolver)Deprecated.voidsetNamingStrategy(FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategy namingStrategy)Deprecated.
 
- 
- 
- 
Field Detail- 
attachmentsDirResolverprotected FileLocationResolver attachmentsDirResolver Deprecated.
 - 
NAMING_STRATEGY_IDpublic static final FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategy NAMING_STRATEGY_ID Deprecated.
 - 
NAMING_STRATEGY_FILE_NAMEpublic static final FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategy NAMING_STRATEGY_FILE_NAME Deprecated.
 
- 
 - 
Method Detail- 
getNamingStrategypublic FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategy getNamingStrategy() Deprecated.
 - 
setNamingStrategypublic void setNamingStrategy(FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategy namingStrategy) Deprecated.
 - 
getConfluenceAttachmentDirectoryprotected File getConfluenceAttachmentDirectory() Deprecated.
 - 
getLatestAttachmentFileprotected File getLatestAttachmentFile(Attachment attachment) Deprecated.
 - 
getDataForAttachmentpublic InputStream getDataForAttachment(Attachment attachment) throws AttachmentDataNotFoundException Deprecated.Description copied from interface:AttachmentDataDaoGrabs the AttachmentData object for an Attachment- Specified by:
- getDataForAttachmentin interface- AttachmentDataDao
- Parameters:
- attachment- the Attachment representing the data
- Returns:
- an AttachmentData object
- Throws:
- AttachmentDataNotFoundException- if no data was found
 
 - 
removeDataForAttachmentpublic void removeDataForAttachment(Attachment attachment, ContentEntityObject originalContent) Deprecated.Removes all attachment data for the given attachment. Since Confluence 4.2 the contract of this method has been clarified. It now removes all versions of the given attachment.This method will remove any empty folders left after removing the attachment data. - Specified by:
- removeDataForAttachmentin interface- AttachmentDataDao
- Parameters:
- attachment- the attachment for which data should be removed
- originalContent- the content the attachment belongs to
 
 - 
removeDataForAttachmentVersionpublic void removeDataForAttachmentVersion(Attachment attachment, ContentEntityObject originalContent) Deprecated.Removes the attachment data for the given attachment version.This method will remove any empty folders left after removing the attachment data. - Specified by:
- removeDataForAttachmentVersionin interface- AttachmentDataDao
- Parameters:
- attachment- the attachment for which data should be removed
- originalContent- the content the attachment belongs to
 
 - 
removeDataForAttachmentVersionpublic void removeDataForAttachmentVersion(Attachment attachment, ContentEntityObject originalContent, AttachmentDataStreamType dataStreamType) Deprecated.Description copied from interface:AttachmentDataDaoRemoves the attachment data of the specific stream type for the given attachment version.- Specified by:
- removeDataForAttachmentVersionin interface- AttachmentDataDao
- Parameters:
- attachment- the version of the attachment for which the data should be removed
- originalContent- the content the attachment belongs to
- dataStreamType- the data stream type
 
 - 
moveDataForAttachmentVersionpublic void moveDataForAttachmentVersion(Attachment sourceAttachmentVersion, Attachment targetAttachmentVersion) Deprecated.Description copied from interface:AttachmentDataDaoMoves the attachment data from oneAbstractVersionedEntityObject.getVersion()to the other.This method will overwrite any existing data for the target attachment version. - Specified by:
- moveDataForAttachmentVersionin interface- AttachmentDataDao
- Parameters:
- sourceAttachmentVersion- the attachment
- See Also:
- AttachmentDataDao.moveAttachment(Attachment, Attachment, ContentEntityObject)
 
 - 
saveDataForAttachmentpublic void saveDataForAttachment(Attachment attachment, InputStream data) Deprecated.Description copied from interface:AttachmentDataDaoSaves data to the attachment data store- Specified by:
- saveDataForAttachmentin interface- AttachmentDataDao
- Parameters:
- attachment- the Attachment the data belongs to
- data- the InputStream to be written
 
 - 
getAttachmentsDirResolverpublic FileLocationResolver getAttachmentsDirResolver() Deprecated.
 - 
saveDataForAttachmentprotected void saveDataForAttachment(Attachment attachment, InputStream data, boolean overwrite) Deprecated.Saves data to the file system- Parameters:
- attachment- the Attachment the data belongs to
- data- the InputStream to be written
- overwrite-
- Throws:
- IllegalArgumentException- if attachment is null
- IllegalArgumentException- if data is null
 
 - 
saveDataForAttachmentVersionpublic void saveDataForAttachmentVersion(Attachment attachment, Attachment previousVersion, InputStream data) Deprecated.Description copied from interface:AttachmentDataDaoSaves data to the attachment data store, for an attachment that has been updated.This method assumes that the attachment has already been saved. - Specified by:
- saveDataForAttachmentVersionin interface- AttachmentDataDao
- Parameters:
- attachment- the new version of the attachment
- previousVersion- the previous version of the attachment
- data- the InputStream representing the data
 
 - 
replaceDataForAttachmentpublic void replaceDataForAttachment(Attachment attachment, InputStream data) Deprecated.Description copied from interface:AttachmentDataDaoSets the data for attachmentThis method will overwrite any existing data for the attachment. - Specified by:
- replaceDataForAttachmentin interface- AttachmentDataDao
- Parameters:
- attachment- Attachment the data belongs to
- data- the data to be saved
 
 - 
isAttachmentPresentpublic boolean isAttachmentPresent(Attachment attachment) Deprecated.Description copied from interface:AttachmentDataDaoCheck that an attachment exists- Specified by:
- isAttachmentPresentin interface- AttachmentDataDao
- Parameters:
- attachment- the Attachment to be checked
 
 - 
moveAttachmentpublic void moveAttachment(Attachment attachment, Attachment oldAttachment, ContentEntityObject newContent) Deprecated.Description copied from interface:AttachmentDataDaoMoves an attachment to a new file name or content object- Specified by:
- moveAttachmentin interface- AttachmentDataDao
- Parameters:
- attachment- the Attachment to be moved
- oldAttachment- the original version of the attachment
- newContent- the new content the Attachment belongs to
 
 - 
getDirectoryForAttachmentprotected File getDirectoryForAttachment(ContentEntityObject content, Attachment attachment) Deprecated.Retrieves the location of the containing folder for an Attachment- Parameters:
- content- the ContentEntityObject the Attachment belongs to
- attachment-
- Returns:
- a File pointing to the location
 
 - 
getDirectoryForContentprotected File getDirectoryForContent(ContentEntityObject content) Deprecated.
 - 
prepareForMigrationTopublic void prepareForMigrationTo() Deprecated.In this implementation, we want to make sure the attachments directory is empty, otherwise we will have attachments or files that don't belong.We also want to make sure the attachments directory actually exists, prior to moving data across. It is the responsibility of the action performing the migration to warn the user about this. - Specified by:
- prepareForMigrationToin interface- AttachmentDataDao
 
 - 
afterMigrationFrompublic void afterMigrationFrom() Deprecated.In this implementation, we leave the filesystem as is, and don't remove the attachments that have just been moved to another data store.- Specified by:
- afterMigrationFromin interface- AttachmentDataDao
 
 - 
setAttachmentsDirResolverpublic void setAttachmentsDirResolver(FileLocationResolver attachmentsDirResolver) Deprecated.
 - 
getDataForAttachmentpublic AttachmentDataStream getDataForAttachment(Attachment attachment, AttachmentDataStreamType dataStreamType) throws AttachmentDataNotFoundException Deprecated.Description copied from interface:AttachmentDataDaoGrabs the AttachmentData object for an Attachment- Specified by:
- getDataForAttachmentin interface- AttachmentDataDao
- Parameters:
- attachment- the Attachment representing the data
- Returns:
- an AttachmentData object
- Throws:
- AttachmentDataNotFoundException- if no data was found
 
 - 
getDataForAttachmentpublic AttachmentDataStream getDataForAttachment(Attachment attachment, AttachmentDataStreamType dataStreamType, Optional<RangeRequest> range) throws AttachmentDataNotFoundException Deprecated.Description copied from interface:AttachmentDataDaoGrabs the AttachmentData object for an Attachment- Specified by:
- getDataForAttachmentin interface- AttachmentDataDao
- Parameters:
- attachment- the Attachment representing the data
- dataStreamType- the stream type of attachment
- range- the range of attachment data
- Returns:
- an AttachmentData object
- Throws:
- AttachmentDataNotFoundException- if no data was found
 
 - 
saveDataForAttachmentpublic void saveDataForAttachment(Attachment attachment, AttachmentDataStream dataStream) Deprecated.Description copied from interface:AttachmentDataDaoSaves data to the attachment data store- Specified by:
- saveDataForAttachmentin interface- AttachmentDataDao
- Parameters:
- attachment- the Attachment the data belongs to
- dataStream- the data stream to be written
 
 - 
saveDataForAttachmentVersionpublic void saveDataForAttachmentVersion(Attachment attachment, Attachment previousVersion, AttachmentDataStream dataStream) Deprecated.Description copied from interface:AttachmentDataDaoSaves data to the attachment data store, for an attachment that has been updated.This method assumes that the attachment has already been saved. - Specified by:
- saveDataForAttachmentVersionin interface- AttachmentDataDao
- Parameters:
- attachment- the new version of the attachment
- previousVersion- the previous version of the attachment
- dataStream- the InputStream representing the data
 
 - 
replaceDataForAttachmentpublic void replaceDataForAttachment(Attachment attachment, AttachmentDataStream dataStream) Deprecated.Description copied from interface:AttachmentDataDaoSets the data for attachmentThis method will overwrite any existing data for the attachment. - Specified by:
- replaceDataForAttachmentin interface- AttachmentDataDao
- Parameters:
- attachment- Attachment the data belongs to
- dataStream- the data to be saved
 
 - 
getStorageTypepublic AttachmentDataStorageType getStorageType() Deprecated.Description copied from interface:AttachmentDataDaoReturns the storage type.The client code should be storage agnostic in general. Thus this method should only be used in rare cases in order to hide operations which are known to be not implemented for the specific type. - Specified by:
- getStorageTypein interface- AttachmentDataDao
- Returns:
- the storage type
 
 
- 
 
-