public abstract class

ServeAfterTransactionDownload

extends Object
implements DownloadStrategy
java.lang.Object
   ↳ com.atlassian.confluence.servlet.download.ServeAfterTransactionDownload
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

This abstract download strategy allows implementors to gather necessary information from a database and set HTTP headers within a database transaction. Streaming of the actual download is done after the transaction is finished so that the database connection lifetime is not bound to the entire request lifetime.

Summary

Nested Classes
class ServeAfterTransactionDownload.StreamResultCallback Spring transactional callback that calls getStreamForDownload within a database transaction  
Public Constructors
ServeAfterTransactionDownload()
Public Methods
static String getDecodedPathInfo(HttpServletRequest httpServletRequest)
final void serveFile(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
void setTransactionManager(PlatformTransactionManager transactionManager)
Protected Methods
abstract InputStream getStreamForDownload(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
Get the input stream to serve to the client outside of the database transaction.
TransactionCallback getStreamResultCallback(HttpServletRequest request, HttpServletResponse response)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.plugin.servlet.DownloadStrategy

Public Constructors

public ServeAfterTransactionDownload ()

Public Methods

public static String getDecodedPathInfo (HttpServletRequest httpServletRequest)

public final void serveFile (HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)

Throws
DownloadException

public void setTransactionManager (PlatformTransactionManager transactionManager)

Protected Methods

protected abstract InputStream getStreamForDownload (HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)

Get 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

Returns
  • The input stream to serve, or null if nothing to serve.
Throws
IOException

protected TransactionCallback getStreamResultCallback (HttpServletRequest request, HttpServletResponse response)