Class ObjectStorageAttachmentDataUtil

java.lang.Object
com.atlassian.confluence.impl.pages.attachments.objectstorage.ObjectStorageAttachmentDataUtil

public class ObjectStorageAttachmentDataUtil extends Object
Since:
8.1
  • Method Details

    • writeStreamToPath

      public static void writeStreamToPath(InputStream data, com.atlassian.dc.filestore.api.FileStore.Path destFile, @Nullable Long expectedFileSize)
      Writes stream to destination file. If the number of bytes in the stream do not match up with the expected size of the attachment an error will be thrown and the write will be aborted.
      Parameters:
      data - attachment body represented as a stream
      destFile - path to copy stream into
      expectedFileSize - expected size of the created file. May be null of no size check is to be performed.
      Throws:
      AttachmentDataStreamSizeMismatchException - if the number of bytes in the stream does not match the expectedAttachmentSize