Interface AttachmentDataFileSystem

All Known Implementing Classes:
ContentDirectoryStructureAttachmentDataFileSystemAdapter, ContentDirectoryStructureAttachmentDataFileSystemV003, ContentDirectoryStructureAttachmentDataFileSystemV004, ObjectStorageAttachmentDataFileSystem

public interface AttachmentDataFileSystem
Represents the filesystem used to store attachment data files.
Since:
7.12
  • Method Details

    • dataExistsForAttachment

      boolean dataExistsForAttachment(AttachmentRef attachment)
      Indicates whether the filesystem contains data for the given attachment
    • moveAttachment

      @Deprecated void moveAttachment(AttachmentRef oldAttachment, AttachmentRef newAttachment, AttachmentRef.Container newContentEntity)
      Deprecated.
      since 8.1.0
      Move all data relating to one attachment to a new directory corresponding to the given new attachment and content entity.
      Parameters:
      oldAttachment - The attachment whose data is to be moved
      newAttachment - The attachment to which the data should be moved to
      newContentEntity - The content entity corresponding to the new attachment
    • saveAttachmentData

      boolean saveAttachmentData(AttachmentRef attachment, AttachmentDataStream dataStream, boolean overwrite, org.springframework.util.unit.DataSize expectedFileSize)
      Save new data corresponding to the given attachment.
      Parameters:
      attachment - The attachment to which the data should be associated
      dataStream - The new data
      overwrite - If true, any existing data will be overwritten. If false, does nothing if data already exists.
      expectedFileSize - The expected size of the data being written
      Returns:
      true if the data was written, false otherwise (e.g. no overwrite)
    • deleteAllAttachmentVersions

      void deleteAllAttachmentVersions(AttachmentRef attachment, AttachmentRef.Container contentEntity)
      Delete all data corresponding to all versions of the given attachment
      Parameters:
      attachment - the attachment whose data is to be deleted
      contentEntity - The content entity associated with the attachment
    • moveDataForAttachmentVersion

      @Deprecated void moveDataForAttachmentVersion(AttachmentRef sourceAttachmentVersion, AttachmentRef targetAttachmentVersion)
      Deprecated.
      since 8.1.0
      Move the data associated with one attachment version, to being associated with a different attachment version
      Parameters:
      sourceAttachmentVersion - The attachment version containing the data
      targetAttachmentVersion - The attachment version to which the data should be moved
    • deleteSingleAttachmentVersion

      void deleteSingleAttachmentVersion(AttachmentRef attachment, AttachmentRef.Container contentEntity)
      Delete the data corresponding to a single attachment version
      Parameters:
      attachment - The attachment whose data should be deleted
      contentEntity - The content entity associated with the attachment
    • deleteSingleAttachmentVersion

      void deleteSingleAttachmentVersion(AttachmentRef attachment, AttachmentRef.Container contentEntity, AttachmentDataStreamType dataStreamType)
      Delete the data of the specified stream type corresponding to a single attachment version
      Parameters:
      attachment - The attachment whose data should be deleted
      contentEntity - The content entity associated with the attachment
      dataStreamType - The attachment stream type
      Since:
      6.5
    • getAttachmentData

      AttachmentDataStream getAttachmentData(AttachmentRef attachment, AttachmentDataStreamType dataStreamType)
      Fetches the data for a given attachment version and data stream type
      Parameters:
      attachment - The attachment version for which the data is to be fetched
      dataStreamType - The type of the data stream to be fetched
      Returns:
      The AttachmentDataStream containing the result
    • getAttachmentData

      AttachmentDataStream getAttachmentData(AttachmentRef attachment, AttachmentDataStreamType dataStreamType, Optional<RangeRequest> range)
      Fetches the specified range of data for a given attachment version and data stream type
      Parameters:
      attachment - The attachment version for which the data is to be fetched
      dataStreamType - The type of the data stream to be fetched
      range - The range of the data stream to be fetched
      Returns:
      The AttachmentDataStream containing the result
    • moveAttachments

      @Deprecated void moveAttachments(AttachmentRef.Container contentEntity, AttachmentRef.Space oldSpace, AttachmentRef.Space newSpace)
      Deprecated.
      since 8.1.0
      Move all data for all versions of all attachments corresponding to the given content entity in the given space, to the same entity in a different space.
      Parameters:
      contentEntity - The content entity whose attachment data is to be moved
      oldSpace - The original space of the content entity
      newSpace - The new space of the content entity
    • prepareForMigrationTo

      @Deprecated void prepareForMigrationTo()
      Deprecated.
      since 8.1.0
      Prepare the data store for a migration from another type of data store.
    • getAttachmentDataFile

      @Deprecated(since="8.3.0") AttachmentDataFile<com.atlassian.dc.filestore.api.compat.FilesystemPath> getAttachmentDataFile(long attachmentId, @Nullable Long containerId, @Nullable Long spaceId, Integer attachmentVersion, AttachmentDataStreamType dataStreamType)
      Deprecated.
      since 8.3.0
      This method won't support S3 attachment storage. Use at your own risk.
    • getStructureVersion

      AttachmentStorageVersion getStructureVersion()
      Version of the attachment storage structure.
      Since:
      8.5.7