Package com.atlassian.confluence.pages
Class DefaultFileUploadManager
java.lang.Object
com.atlassian.confluence.pages.DefaultFileUploadManager
- All Implemented Interfaces:
FileUploadManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetAttachmentManager(AttachmentManager attachmentManager) voidsetClusterLockService(com.atlassian.beehive.ClusterLockService clusterLockService) voidsetContentEntityManager(ContentEntityManager contentEntityManager) voidsetMimeTypeTranslator(AttachmentMimeTypeTranslator mimeTypeTranslator) voidsetTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) voidstoreResource(AttachmentResource resource, ContentEntityObject ceo) Stores the attachmentResource as anAttachmenton the specified content object.voidstoreResources(@NonNull Collection<AttachmentResource> attachmentResources, ContentEntityObject content) Stores one or more attachment resources against the given content.
-
Field Details
-
OCTET_STREAM_MIME_TYPE
- See Also:
-
-
Constructor Details
-
DefaultFileUploadManager
public DefaultFileUploadManager()
-
-
Method Details
-
storeResource
Description copied from interface:FileUploadManagerStores the attachmentResource as anAttachmenton the specified content object.- Specified by:
storeResourcein interfaceFileUploadManager- Parameters:
resource- contains the required state to create an attachmentceo- 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:
- 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. - Retry loop — re-attempts the store on transient
OptimisticLockingFailureExceptions (default: 2 attempts).
- Specified by:
storeResourcesin interfaceFileUploadManager- Parameters:
attachmentResources- the attachments to storecontent- the content to attach them to; used only to obtain the content ID — the entity is reloaded inside each transaction attempt
- Per-content cluster lock (
-
setAttachmentManager
-
setMimeTypeTranslator
-
setClusterLockService
public void setClusterLockService(com.atlassian.beehive.ClusterLockService clusterLockService) -
setContentEntityManager
-
setTransactionManager
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
-