Package org.eclipse.jgit.lfs.server.fs
Class ObjectUploadListener
- java.lang.Object
-
- org.eclipse.jgit.lfs.server.fs.ObjectUploadListener
-
- All Implemented Interfaces:
EventListener
,javax.servlet.ReadListener
public class ObjectUploadListener extends Object implements javax.servlet.ReadListener
Handle asynchronous object upload.- Since:
- 4.6
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ObjectUploadListener.Callback
Callback invoked after object upload completed.
-
Constructor Summary
Constructors Constructor Description ObjectUploadListener(FileLfsRepository repository, javax.servlet.AsyncContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AnyLongObjectId id)
Constructor for ObjectUploadListener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
close()
Close resources held by this listenervoid
onAllDataRead()
void
onDataAvailable()
Writes all the received data to the output channelvoid
onError(Throwable e)
ObjectUploadListener
setCallback(ObjectUploadListener.Callback callback)
Set the callback to invoke after upload completed.
-
-
-
Constructor Detail
-
ObjectUploadListener
public ObjectUploadListener(FileLfsRepository repository, javax.servlet.AsyncContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AnyLongObjectId id) throws FileNotFoundException, IOException
Constructor for ObjectUploadListener.- Parameters:
repository
- the repository storing large objectscontext
- aAsyncContext
object.request
- aHttpServletRequest
object.response
- aHttpServletResponse
object.id
- aAnyLongObjectId
object.- Throws:
FileNotFoundException
IOException
-
-
Method Detail
-
setCallback
public ObjectUploadListener setCallback(ObjectUploadListener.Callback callback)
Set the callback to invoke after upload completed.- Parameters:
callback
- the callback- Returns:
this
.- Since:
- 5.1.7
-
onDataAvailable
public void onDataAvailable() throws IOException
Writes all the received data to the output channel- Specified by:
onDataAvailable
in interfacejavax.servlet.ReadListener
- Throws:
IOException
-
onAllDataRead
public void onAllDataRead() throws IOException
- Specified by:
onAllDataRead
in interfacejavax.servlet.ReadListener
- Throws:
IOException
-
close
protected void close() throws IOException
Close resources held by this listener- Throws:
IOException
-
onError
public void onError(Throwable e)
- Specified by:
onError
in interfacejavax.servlet.ReadListener
-
-