Class FileSystemAttachmentDataDao
- java.lang.Object
-
- com.atlassian.confluence.pages.persistence.dao.filesystem.FileSystemAttachmentDataDao
-
- All Implemented Interfaces:
AttachmentDataDao,NonTransactionalAttachmentDataDao
@Deprecated public class FileSystemAttachmentDataDao extends Object implements NonTransactionalAttachmentDataDao
Deprecated.since 7.12 UseFileSystemAttachmentDataDaoAn implementation ofAttachmentDataDaowhich stores the attachment data as files on local filesystem, using the standardFileAPI or as blob on remote filesystem, usingcom.atlassian.filestore.client.api.FileStoreClientAPI via theAttachmentDataFileSysteminterface.- Since:
- 5.5
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTACHMENT_SUBDIRECTORY_NAMEDeprecated.
-
Constructor Summary
Constructors Constructor Description FileSystemAttachmentDataDao(AttachmentDataFileSystem fileSystem)Deprecated.
-
Method Summary
All 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.AttachmentDataFileSystemgetAttachmentDataFileSystem()Deprecated.InputStreamgetDataForAttachment(Attachment attachment)Deprecated.AttachmentDataStreamgetDataForAttachment(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 AttachmentAttachmentDataStorageTypegetStorageType()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.Prepare the data store for a migration from another type of data store.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.voidsaveDataForAttachment(Attachment attachment, AttachmentDataStream dataStream)Deprecated.Saves data to the attachment data storevoidsaveDataForAttachment(Attachment attachment, InputStream data)Deprecated.voidsaveDataForAttachmentVersion(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.
-
-
-
Field Detail
-
ATTACHMENT_SUBDIRECTORY_NAME
public static final String ATTACHMENT_SUBDIRECTORY_NAME
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FileSystemAttachmentDataDao
public FileSystemAttachmentDataDao(AttachmentDataFileSystem fileSystem)
Deprecated.
-
-
Method Detail
-
getDataForAttachment
@Deprecated public InputStream getDataForAttachment(Attachment attachment) throws AttachmentDataNotFoundException
Deprecated.Grabs the AttachmentData object for an Attachment- Specified by:
getDataForAttachmentin interfaceAttachmentDataDao- Parameters:
attachment- the Attachment representing the data- Returns:
- an AttachmentData object
- Throws:
AttachmentDataNotFoundException- if no data was found
-
getDataForAttachment
public AttachmentDataStream getDataForAttachment(Attachment attachment, AttachmentDataStreamType dataStreamType) throws AttachmentDataNotFoundException
Deprecated.Description copied from interface:AttachmentDataDaoGrabs the AttachmentData object for an Attachment- Specified by:
getDataForAttachmentin interfaceAttachmentDataDao- Parameters:
attachment- the Attachment representing the data- Returns:
- an AttachmentData object
- Throws:
AttachmentDataNotFoundException- if no data was found
-
getDataForAttachment
public 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 interfaceAttachmentDataDao- Parameters:
attachment- the Attachment representing the datadataStreamType- the stream type of attachmentrange- the range of attachment data- Returns:
- an AttachmentData object
- Throws:
AttachmentDataNotFoundException- if no data was found
-
removeDataForAttachment
public 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.- Specified by:
removeDataForAttachmentin interfaceAttachmentDataDao- Parameters:
attachment- the latest version of the attachment for which the data should be removedoriginalContent- the content the attachment belongs to
-
removeDataForAttachmentVersion
public void removeDataForAttachmentVersion(Attachment attachment, ContentEntityObject originalContent)
Deprecated.Removes the attachment data for the given attachment version.- Specified by:
removeDataForAttachmentVersionin interfaceAttachmentDataDao- Parameters:
attachment- the version of the attachment for which the data should be removedoriginalContent- the content the attachment belongs to
-
removeDataForAttachmentVersion
public 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 interfaceAttachmentDataDao- Parameters:
attachment- the version of the attachment for which the data should be removedoriginalContent- the content the attachment belongs todataStreamType- the data stream type
-
moveDataForAttachmentVersion
public void moveDataForAttachmentVersion(Attachment sourceAttachmentVersion, Attachment targetAttachmentVersion)
Deprecated.Moves the attachment data from oneAbstractVersionedEntityObject.getVersion()to the other.This method will overwrite any existing data for the target attachment version.
- Specified by:
moveDataForAttachmentVersionin interfaceAttachmentDataDao- Parameters:
sourceAttachmentVersion- the attachment- See Also:
AttachmentDataDao.moveAttachment(Attachment, Attachment, ContentEntityObject)
-
saveDataForAttachment
@Deprecated public void saveDataForAttachment(Attachment attachment, InputStream data)
Deprecated.Saves data to the attachment data store- Specified by:
saveDataForAttachmentin interfaceAttachmentDataDao- Parameters:
attachment- the Attachment the data belongs todata- the InputStream to be written
-
saveDataForAttachment
public void saveDataForAttachment(Attachment attachment, AttachmentDataStream dataStream)
Deprecated.Description copied from interface:AttachmentDataDaoSaves data to the attachment data store- Specified by:
saveDataForAttachmentin interfaceAttachmentDataDao- Parameters:
attachment- the Attachment the data belongs todataStream- the data stream to be written
-
saveDataForAttachmentVersion
@Deprecated public void saveDataForAttachmentVersion(Attachment attachment, Attachment previousVersion, InputStream data)
Deprecated.Saves 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 interfaceAttachmentDataDao- Parameters:
attachment- the new version of the attachmentpreviousVersion- the previous version of the attachmentdata- the InputStream representing the data
-
saveDataForAttachmentVersion
public 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 interfaceAttachmentDataDao- Parameters:
attachment- the new version of the attachmentpreviousVersion- the previous version of the attachmentdataStream- the InputStream representing the data
-
replaceDataForAttachment
@Deprecated public void replaceDataForAttachment(Attachment attachment, InputStream data)
Deprecated.Sets the data for attachmentThis method will overwrite any existing data for the attachment.
- Specified by:
replaceDataForAttachmentin interfaceAttachmentDataDao- Parameters:
attachment- Attachment the data belongs todata- the data to be saved
-
replaceDataForAttachment
public 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 interfaceAttachmentDataDao- Parameters:
attachment- Attachment the data belongs todataStream- the data to be saved
-
isAttachmentPresent
public boolean isAttachmentPresent(Attachment attachment)
Deprecated.Description copied from interface:AttachmentDataDaoCheck that an attachment exists- Specified by:
isAttachmentPresentin interfaceAttachmentDataDao- Parameters:
attachment- the Attachment to be checked
-
moveAttachment
public 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 interfaceAttachmentDataDao- Parameters:
attachment- the Attachment to be movedoldAttachment- the original version of the attachmentnewContent- the new content the Attachment belongs to
-
prepareForMigrationTo
public void prepareForMigrationTo()
Deprecated.Description copied from interface:AttachmentDataDaoPrepare 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.
Implementations may circumvent hibernate, so should only be called when nobody else can see the attachment data.
- Specified by:
prepareForMigrationToin interfaceAttachmentDataDao
-
afterMigrationFrom
public 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 interfaceAttachmentDataDao
-
getStorageType
public final 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 interfaceAttachmentDataDao- Returns:
- the storage type
-
getAttachmentDataFileSystem
public AttachmentDataFileSystem getAttachmentDataFileSystem()
Deprecated.
-
-