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 interfaceObjectUploadListener.CallbackCallback 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 voidclose()Close resources held by this listenervoidonAllDataRead()voidonDataAvailable()Writes all the received data to the output channelvoidonError(Throwable e)ObjectUploadListenersetCallback(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- aAsyncContextobject.request- aHttpServletRequestobject.response- aHttpServletResponseobject.id- aAnyLongObjectIdobject.- Throws:
FileNotFoundExceptionIOException
-
-
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 IOExceptionWrites all the received data to the output channel- Specified by:
onDataAvailablein interfacejavax.servlet.ReadListener- Throws:
IOException
-
onAllDataRead
public void onAllDataRead() throws IOException- Specified by:
onAllDataReadin interfacejavax.servlet.ReadListener- Throws:
IOException
-
close
protected void close() throws IOExceptionClose resources held by this listener- Throws:
IOException
-
onError
public void onError(Throwable e)
- Specified by:
onErrorin interfacejavax.servlet.ReadListener
-
-