Class DefaultFileUploadManager

java.lang.Object
com.atlassian.confluence.pages.DefaultFileUploadManager
All Implemented Interfaces:
FileUploadManager

public class DefaultFileUploadManager extends Object implements FileUploadManager
  • Field Details

  • Constructor Details

    • DefaultFileUploadManager

      public DefaultFileUploadManager()
  • Method Details

    • storeResource

      public void storeResource(AttachmentResource resource, ContentEntityObject ceo)
      Description copied from interface: FileUploadManager
      Stores the attachmentResource as an Attachment on the specified content object.
      Specified by:
      storeResource in interface FileUploadManager
      Parameters:
      resource - contains the required state to create an attachment
      ceo - the content object which the attachment will be attached to
    • storeResources

      public void storeResources(@NonNull Collection<AttachmentResource> attachmentResources, ContentEntityObject content)
      Stores one or more attachment resources against the given content.

      This is the single choke-point for all upload paths (UI, drag-and-drop, REST, SOAP). To guard against concurrent uploads to the same content it applies two layers of protection:

      1. Per-content cluster lock (withUploadLock(long, java.lang.Runnable)) — serialises all uploads to the same content ID across every node in the cluster. Uploads to different content proceed concurrently.
      2. Retry loop — re-attempts the store on transient OptimisticLockingFailureExceptions (default: 2 attempts).
      Specified by:
      storeResources in interface FileUploadManager
      Parameters:
      attachmentResources - the attachments to store
      content - the content to attach them to; used only to obtain the content ID — the entity is reloaded inside each transaction attempt
    • setAttachmentManager

      public void setAttachmentManager(AttachmentManager attachmentManager)
    • setMimeTypeTranslator

      public void setMimeTypeTranslator(AttachmentMimeTypeTranslator mimeTypeTranslator)
    • setClusterLockService

      public void setClusterLockService(com.atlassian.beehive.ClusterLockService clusterLockService)
    • setContentEntityManager

      public void setContentEntityManager(ContentEntityManager contentEntityManager)
    • setTransactionManager

      public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)