Class AttachmentDownload
java.lang.Object
com.atlassian.confluence.servlet.download.ServeAfterTransactionDownload
com.atlassian.confluence.servlet.download.AttachmentDownload
- All Implemented Interfaces:
com.atlassian.plugin.servlet.DownloadStrategy
- Direct Known Subclasses:
ThumbnailDownload
-
Nested Class Summary
Nested classes/interfaces inherited from class com.atlassian.confluence.servlet.download.ServeAfterTransactionDownload
ServeAfterTransactionDownload.StreamResultCallback -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.atlassian.event.api.EventPublisher@Nullable InputStreamgetStreamForDownload(jakarta.servlet.http.HttpServletRequest httpServletRequest, jakarta.servlet.http.HttpServletResponse httpServletResponse) Get the input stream to serve to the client outside of the database transaction.protected Stringbooleanprotected voidpublishEvents(Attachment attachment, boolean download) voidsetAttachmentSafeContentHeaderGuesser(SafeContentHeaderGuesser attachmentSafeContentHeaderGuesser) voidsetAttachmentUrlParser(AttachmentUrlParser attachmentUrlParser) voidsetDownloadResourceManager(DownloadResourceManager downloadResourceManager) voidsetEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher) protected voidsetHeadersForAttachment(InputStream contents, String name, long contentLength, String contentType, jakarta.servlet.http.HttpServletRequest httpServletRequest, jakarta.servlet.http.HttpServletResponse httpServletResponse) voidsetTokenGenerator(com.atlassian.struts.xsrf.XsrfTokenGenerator tokenGenerator) protected voidstreamResponse(InputStream fromStream, OutputStream toStream) Captures and publishes analytics about the attachment streaming.Methods inherited from class com.atlassian.confluence.servlet.download.ServeAfterTransactionDownload
getDecodedPathInfo, getStreamResultCallback, serveFile, setTransactionManager
-
Field Details
-
JWT_REQUEST_USERNAME
- See Also:
-
-
Constructor Details
-
AttachmentDownload
public AttachmentDownload()
-
-
Method Details
-
matches
-
setDownloadResourceManager
-
setAttachmentUrlParser
-
setEventPublisher
public void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher) -
getEventPublisher
public com.atlassian.event.api.EventPublisher getEventPublisher() -
setTokenGenerator
public void setTokenGenerator(com.atlassian.struts.xsrf.XsrfTokenGenerator tokenGenerator) -
getStreamForDownload
public @Nullable InputStream getStreamForDownload(jakarta.servlet.http.HttpServletRequest httpServletRequest, jakarta.servlet.http.HttpServletResponse httpServletResponse) throws IOException Description copied from class:ServeAfterTransactionDownloadGet the input stream to serve to the client outside of the database transaction. The inputstream must be useable outside of the database transaction that created it- Specified by:
getStreamForDownloadin classServeAfterTransactionDownload- Returns:
- The input stream to serve, or null if nothing to serve.
- Throws:
IOException
-
publishEvents
-
getUrlPrefix
-
setHeadersForAttachment
protected void setHeadersForAttachment(InputStream contents, String name, long contentLength, String contentType, jakarta.servlet.http.HttpServletRequest httpServletRequest, jakarta.servlet.http.HttpServletResponse httpServletResponse) throws IOException - Throws:
IOException
-
setAttachmentSafeContentHeaderGuesser
public void setAttachmentSafeContentHeaderGuesser(SafeContentHeaderGuesser attachmentSafeContentHeaderGuesser) -
streamResponse
Captures and publishes analytics about the attachment streaming.- Overrides:
streamResponsein classServeAfterTransactionDownload- Throws:
IOException- Since:
- 7.12
-
getStreamingAnalyticsEventName
- Since:
- 7.12
-