public class ObjectDownloadListener
extends java.lang.Object
implements javax.servlet.WriteListener
Modifier and Type | Field and Description |
---|---|
private java.nio.ByteBuffer |
buffer |
private javax.servlet.AsyncContext |
context |
private java.nio.channels.ReadableByteChannel |
in |
private static java.util.logging.Logger |
LOG |
private javax.servlet.ServletOutputStream |
out |
private java.nio.channels.WritableByteChannel |
outChannel |
private javax.servlet.http.HttpServletResponse |
response |
Constructor and Description |
---|
ObjectDownloadListener(FileLfsRepository repository,
javax.servlet.AsyncContext context,
javax.servlet.http.HttpServletResponse response,
AnyLongObjectId id)
Constructor for ObjectDownloadListener.
|
Modifier and Type | Method and Description |
---|---|
void |
onError(java.lang.Throwable e)
Handle errors
|
void |
onWritePossible()
Write file content
|
private static java.util.logging.Logger LOG
private final javax.servlet.AsyncContext context
private final javax.servlet.http.HttpServletResponse response
private final javax.servlet.ServletOutputStream out
private final java.nio.channels.ReadableByteChannel in
private final java.nio.channels.WritableByteChannel outChannel
private java.nio.ByteBuffer buffer
public ObjectDownloadListener(FileLfsRepository repository, javax.servlet.AsyncContext context, javax.servlet.http.HttpServletResponse response, AnyLongObjectId id) throws java.io.IOException
Constructor for ObjectDownloadListener.
repository
- the repository storing large objectscontext
- the servlet asynchronous contextresponse
- the servlet responseid
- id of the object to be downloadedjava.io.IOException
public void onWritePossible() throws java.io.IOException
onWritePossible
in interface javax.servlet.WriteListener
java.io.IOException
public void onError(java.lang.Throwable e)
onError
in interface javax.servlet.WriteListener