Class FileSystemAttachmentDataDao
- All Implemented Interfaces:
AttachmentDataDao
,NonTransactionalAttachmentDataDao
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Deprecated. -
Field Summary
Modifier and TypeFieldDescriptionprotected FileLocationResolver
Deprecated.Deprecated.Deprecated. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.Deprecated.protected File
Deprecated.getDataForAttachment
(Attachment attachment) Deprecated.Grabs the AttachmentData object for an AttachmentgetDataForAttachment
(Attachment attachment, AttachmentDataStreamType dataStreamType) Deprecated.Grabs the AttachmentData object for an AttachmentgetDataForAttachment
(Attachment attachment, AttachmentDataStreamType dataStreamType, Optional<RangeRequest> range) Deprecated.Grabs the AttachmentData object for an Attachmentprotected File
getDirectoryForAttachment
(ContentEntityObject content, Attachment attachment) Deprecated.Retrieves the location of the containing folder for an Attachmentprotected File
Deprecated.protected File
getLatestAttachmentFile
(Attachment attachment) Deprecated.Deprecated.Deprecated.Returns the storage type.boolean
isAttachmentPresent
(Attachment attachment) Deprecated.Check that an attachment existsvoid
moveAttachment
(Attachment attachment, Attachment oldAttachment, ContentEntityObject newContent) Deprecated.Moves an attachment to a new file name or content objectvoid
moveDataForAttachmentVersion
(Attachment sourceAttachmentVersion, Attachment targetAttachmentVersion) Deprecated.Moves the attachment data from oneAbstractVersionedEntityObject.getVersion()
to the other.void
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.void
removeDataForAttachment
(Attachment attachment, ContentEntityObject originalContent) Deprecated.Removes all attachment data for the given attachment.void
removeDataForAttachmentVersion
(Attachment attachment, ContentEntityObject originalContent) Deprecated.Removes the attachment data for the given attachment version.void
removeDataForAttachmentVersion
(Attachment attachment, ContentEntityObject originalContent, AttachmentDataStreamType dataStreamType) Deprecated.Removes the attachment data of the specific stream type for the given attachment version.void
replaceDataForAttachment
(Attachment attachment, AttachmentDataStream dataStream) Deprecated.Sets the data for attachmentvoid
replaceDataForAttachment
(Attachment attachment, InputStream data) Deprecated.Sets the data for attachmentvoid
saveDataForAttachment
(Attachment attachment, AttachmentDataStream dataStream) Deprecated.Saves data to the attachment data storevoid
saveDataForAttachment
(Attachment attachment, InputStream data) Deprecated.Saves data to the attachment data storeprotected void
saveDataForAttachment
(Attachment attachment, InputStream data, boolean overwrite) Deprecated.Saves data to the file systemvoid
saveDataForAttachmentVersion
(Attachment attachment, Attachment previousVersion, AttachmentDataStream dataStream) Deprecated.Saves data to the attachment data store, for an attachment that has been updated.void
saveDataForAttachmentVersion
(Attachment attachment, Attachment previousVersion, InputStream data) Deprecated.Saves data to the attachment data store, for an attachment that has been updated.void
setAttachmentsDirResolver
(FileLocationResolver attachmentsDirResolver) Deprecated.void
Deprecated.
-
Field Details
-
attachmentsDirResolver
Deprecated. -
NAMING_STRATEGY_ID
public static final FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategy NAMING_STRATEGY_IDDeprecated. -
NAMING_STRATEGY_FILE_NAME
public static final FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategy NAMING_STRATEGY_FILE_NAMEDeprecated.
-
-
Constructor Details
-
FileSystemAttachmentDataDao
public FileSystemAttachmentDataDao()Deprecated.
-
-
Method Details
-
getNamingStrategy
Deprecated. -
setNamingStrategy
public void setNamingStrategy(FileSystemAttachmentDataDao.FileSystemAttachmentNamingStrategy namingStrategy) Deprecated. -
getConfluenceAttachmentDirectory
Deprecated. -
getLatestAttachmentFile
Deprecated. -
getDataForAttachment
public InputStream getDataForAttachment(Attachment attachment) throws AttachmentDataNotFoundException Deprecated.Description copied from interface:AttachmentDataDao
Grabs the AttachmentData object for an Attachment- Specified by:
getDataForAttachment
in interfaceAttachmentDataDao
- Parameters:
attachment
- the Attachment representing the data- Returns:
- an AttachmentData object
- Throws:
AttachmentDataNotFoundException
- if no data was found
-
removeDataForAttachment
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:
removeDataForAttachment
in interfaceAttachmentDataDao
- Parameters:
attachment
- the attachment for which 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.This method will remove any empty folders left after removing the attachment data.
- Specified by:
removeDataForAttachmentVersion
in interfaceAttachmentDataDao
- Parameters:
attachment
- the attachment for which 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:AttachmentDataDao
Removes the attachment data of the specific stream type for the given attachment version.- Specified by:
removeDataForAttachmentVersion
in 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.Description copied from interface:AttachmentDataDao
Moves the attachment data from oneAbstractVersionedEntityObject.getVersion()
to the other.This method will overwrite any existing data for the target attachment version.
- Specified by:
moveDataForAttachmentVersion
in interfaceAttachmentDataDao
- Parameters:
sourceAttachmentVersion
- the attachment- See Also:
-
saveDataForAttachment
Deprecated.Description copied from interface:AttachmentDataDao
Saves data to the attachment data store- Specified by:
saveDataForAttachment
in interfaceAttachmentDataDao
- Parameters:
attachment
- the Attachment the data belongs todata
- the InputStream to be written
-
getAttachmentsDirResolver
Deprecated. -
saveDataForAttachment
Deprecated.Saves data to the file system- Parameters:
attachment
- the Attachment the data belongs todata
- the InputStream to be writtenoverwrite
-- Throws:
IllegalArgumentException
- if attachment is nullIllegalArgumentException
- if data is null
-
saveDataForAttachmentVersion
public void saveDataForAttachmentVersion(Attachment attachment, Attachment previousVersion, InputStream data) Deprecated.Description copied from interface:AttachmentDataDao
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:
saveDataForAttachmentVersion
in interfaceAttachmentDataDao
- Parameters:
attachment
- the new version of the attachmentpreviousVersion
- the previous version of the attachmentdata
- the InputStream representing the data
-
replaceDataForAttachment
Deprecated.Description copied from interface:AttachmentDataDao
Sets the data for attachmentThis method will overwrite any existing data for the attachment.
- Specified by:
replaceDataForAttachment
in interfaceAttachmentDataDao
- Parameters:
attachment
- Attachment the data belongs todata
- the data to be saved
-
isAttachmentPresent
Deprecated.Description copied from interface:AttachmentDataDao
Check that an attachment exists- Specified by:
isAttachmentPresent
in interfaceAttachmentDataDao
- Parameters:
attachment
- the Attachment to be checked
-
moveAttachment
public void moveAttachment(Attachment attachment, Attachment oldAttachment, ContentEntityObject newContent) Deprecated.Description copied from interface:AttachmentDataDao
Moves an attachment to a new file name or content object- Specified by:
moveAttachment
in interfaceAttachmentDataDao
- Parameters:
attachment
- the Attachment to be movedoldAttachment
- the original version of the attachmentnewContent
- the new content the Attachment belongs to
-
getDirectoryForAttachment
Deprecated.Retrieves the location of the containing folder for an Attachment- Parameters:
content
- the ContentEntityObject the Attachment belongs toattachment
-- Returns:
- a File pointing to the location
-
getDirectoryForContent
Deprecated. -
prepareForMigrationTo
public 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:
prepareForMigrationTo
in 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:
afterMigrationFrom
in interfaceAttachmentDataDao
-
setAttachmentsDirResolver
Deprecated. -
getDataForAttachment
public AttachmentDataStream getDataForAttachment(Attachment attachment, AttachmentDataStreamType dataStreamType) throws AttachmentDataNotFoundException Deprecated.Description copied from interface:AttachmentDataDao
Grabs the AttachmentData object for an Attachment- Specified by:
getDataForAttachment
in 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:AttachmentDataDao
Grabs the AttachmentData object for an Attachment- Specified by:
getDataForAttachment
in 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
-
saveDataForAttachment
Deprecated.Description copied from interface:AttachmentDataDao
Saves data to the attachment data store- Specified by:
saveDataForAttachment
in interfaceAttachmentDataDao
- Parameters:
attachment
- the Attachment the data belongs todataStream
- the data stream to be written
-
saveDataForAttachmentVersion
public void saveDataForAttachmentVersion(Attachment attachment, Attachment previousVersion, AttachmentDataStream dataStream) Deprecated.Description copied from interface:AttachmentDataDao
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:
saveDataForAttachmentVersion
in interfaceAttachmentDataDao
- Parameters:
attachment
- the new version of the attachmentpreviousVersion
- the previous version of the attachmentdataStream
- the InputStream representing the data
-
replaceDataForAttachment
Deprecated.Description copied from interface:AttachmentDataDao
Sets the data for attachmentThis method will overwrite any existing data for the attachment.
- Specified by:
replaceDataForAttachment
in interfaceAttachmentDataDao
- Parameters:
attachment
- Attachment the data belongs todataStream
- the data to be saved
-
getStorageType
Deprecated.Description copied from interface:AttachmentDataDao
Returns 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:
getStorageType
in interfaceAttachmentDataDao
- Returns:
- the storage type
-
com.atlassian.confluence.pages.persistence.dao.filesystem.FileSystemAttachmentDataDao