FileSystemAttachmentDataDao
@Deprecated public class FileSystemAttachmentDataDao extends Object implements NonTransactionalAttachmentDataDao
AttachmentDataDao
which stores the
attachment data as files on local filesystem, using the standard File
API
or as blob on remote filesystem, using FileStoreClient
API
via the AttachmentDataFileSystem
interface.Modifier and Type | Field and Description |
---|---|
static String |
ATTACHMENT_SUBDIRECTORY_NAME
Deprecated.
|
Constructor and Description |
---|
FileSystemAttachmentDataDao(AttachmentDataFileSystem fileSystem)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
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.
|
AttachmentDataFileSystem |
getAttachmentDataFileSystem()
Deprecated.
|
InputStream |
getDataForAttachment(Attachment attachment)
Deprecated.
|
AttachmentDataStream |
getDataForAttachment(Attachment attachment,
AttachmentDataStreamType dataStreamType)
Deprecated.
Grabs the AttachmentData object for an Attachment
|
AttachmentDataStream |
getDataForAttachment(Attachment attachment,
AttachmentDataStreamType dataStreamType,
Optional<RangeRequest> range)
Deprecated.
Grabs the AttachmentData object for an Attachment
|
AttachmentDataStorageType |
getStorageType()
Deprecated.
Returns the storage type.
|
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
|
void |
moveDataForAttachmentVersion(Attachment sourceAttachmentVersion,
Attachment targetAttachmentVersion)
Deprecated.
Moves the attachment data from one
AbstractVersionedEntityObject.getVersion() to the other. |
void |
prepareForMigrationTo()
Deprecated.
Prepare the data store for a migration from another type of data store.
|
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 attachment
|
void |
replaceDataForAttachment(Attachment attachment,
InputStream data)
Deprecated.
|
void |
saveDataForAttachment(Attachment attachment,
AttachmentDataStream dataStream)
Deprecated.
Saves data to the attachment data store
|
void |
saveDataForAttachment(Attachment attachment,
InputStream data)
Deprecated.
|
void |
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.
|
public static final String ATTACHMENT_SUBDIRECTORY_NAME
public FileSystemAttachmentDataDao(AttachmentDataFileSystem fileSystem)
@Deprecated public InputStream getDataForAttachment(Attachment attachment) throws AttachmentDataNotFoundException
getDataForAttachment
in interface AttachmentDataDao
attachment
- the Attachment representing the dataAttachmentDataNotFoundException
- if no data was foundpublic AttachmentDataStream getDataForAttachment(Attachment attachment, AttachmentDataStreamType dataStreamType) throws AttachmentDataNotFoundException
AttachmentDataDao
getDataForAttachment
in interface AttachmentDataDao
attachment
- the Attachment representing the dataAttachmentDataNotFoundException
- if no data was foundpublic AttachmentDataStream getDataForAttachment(Attachment attachment, AttachmentDataStreamType dataStreamType, Optional<RangeRequest> range) throws AttachmentDataNotFoundException
AttachmentDataDao
getDataForAttachment
in interface AttachmentDataDao
attachment
- the Attachment representing the datadataStreamType
- the stream type of attachmentrange
- the range of attachment dataAttachmentDataNotFoundException
- if no data was foundpublic void removeDataForAttachment(Attachment attachment, ContentEntityObject originalContent)
removeDataForAttachment
in interface AttachmentDataDao
attachment
- the latest version of the attachment for which the data should be removedoriginalContent
- the content the attachment belongs topublic void removeDataForAttachmentVersion(Attachment attachment, ContentEntityObject originalContent)
removeDataForAttachmentVersion
in interface AttachmentDataDao
attachment
- the version of the attachment for which the data should be removedoriginalContent
- the content the attachment belongs topublic void removeDataForAttachmentVersion(Attachment attachment, ContentEntityObject originalContent, AttachmentDataStreamType dataStreamType)
AttachmentDataDao
removeDataForAttachmentVersion
in interface AttachmentDataDao
attachment
- the version of the attachment for which the data should be removedoriginalContent
- the content the attachment belongs todataStreamType
- the data stream typepublic void moveDataForAttachmentVersion(Attachment sourceAttachmentVersion, Attachment targetAttachmentVersion)
AbstractVersionedEntityObject.getVersion()
to the other.
This method will overwrite any existing data for the target attachment version.
moveDataForAttachmentVersion
in interface AttachmentDataDao
sourceAttachmentVersion
- the attachmentAttachmentDataDao.moveAttachment(Attachment, Attachment, ContentEntityObject)
@Deprecated public void saveDataForAttachment(Attachment attachment, InputStream data)
saveDataForAttachment
in interface AttachmentDataDao
attachment
- the Attachment the data belongs todata
- the InputStream to be writtenpublic void saveDataForAttachment(Attachment attachment, AttachmentDataStream dataStream)
AttachmentDataDao
saveDataForAttachment
in interface AttachmentDataDao
attachment
- the Attachment the data belongs todataStream
- the data stream to be written@Deprecated public void saveDataForAttachmentVersion(Attachment attachment, Attachment previousVersion, InputStream data)
This method assumes that the attachment has already been saved.
saveDataForAttachmentVersion
in interface AttachmentDataDao
attachment
- the new version of the attachmentpreviousVersion
- the previous version of the attachmentdata
- the InputStream representing the datapublic void saveDataForAttachmentVersion(Attachment attachment, Attachment previousVersion, AttachmentDataStream dataStream)
AttachmentDataDao
This method assumes that the attachment has already been saved.
saveDataForAttachmentVersion
in interface AttachmentDataDao
attachment
- the new version of the attachmentpreviousVersion
- the previous version of the attachmentdataStream
- the InputStream representing the data@Deprecated public void replaceDataForAttachment(Attachment attachment, InputStream data)
This method will overwrite any existing data for the attachment.
replaceDataForAttachment
in interface AttachmentDataDao
attachment
- Attachment the data belongs todata
- the data to be savedpublic void replaceDataForAttachment(Attachment attachment, AttachmentDataStream dataStream)
AttachmentDataDao
This method will overwrite any existing data for the attachment.
replaceDataForAttachment
in interface AttachmentDataDao
attachment
- Attachment the data belongs todataStream
- the data to be savedpublic boolean isAttachmentPresent(Attachment attachment)
AttachmentDataDao
isAttachmentPresent
in interface AttachmentDataDao
attachment
- the Attachment to be checkedpublic 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 topublic void prepareForMigrationTo()
AttachmentDataDao
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.
prepareForMigrationTo
in interface AttachmentDataDao
public void afterMigrationFrom()
afterMigrationFrom
in interface AttachmentDataDao
public final AttachmentDataStorageType getStorageType()
AttachmentDataDao
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.
getStorageType
in interface AttachmentDataDao
public AttachmentDataFileSystem getAttachmentDataFileSystem()
Copyright © 2003–2021 Atlassian. All rights reserved.