Package org.eclipse.jgit.http.server
Interface UploadPackErrorHandler
public interface UploadPackErrorHandler
Handle git-upload-pack errors.
This is an entry point for customizing an error handler for git-upload-pack.
Right before calling UploadPack.uploadWithExceptionPropagation(java.io.InputStream, java.io.OutputStream, java.io.OutputStream), JGit
will call this handler if specified through GitFilter. The
implementation of this handler is responsible for calling
UploadPackErrorHandler.UploadPackRunnable and handling exceptions for clients.
If a custom handler is not specified, JGit will use the default error handler.
- Since:
- 5.6
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceProcess a git-upload-pack request. -
Method Summary
Modifier and TypeMethodDescriptionstatic intstatusCodeForThrowable(Throwable error) Maps a thrown git related Exception to an appropriate HTTP status code.voidupload(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse rsp, UploadPackErrorHandler.UploadPackRunnable r) Upload pack
-
Method Details
-
statusCodeForThrowable
Maps a thrown git related Exception to an appropriate HTTP status code.- Parameters:
error- The thrown Exception.- Returns:
- the HTTP status code as an int
- Since:
- 6.1.1
-
upload
void upload(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse rsp, UploadPackErrorHandler.UploadPackRunnable r) throws IOException Upload pack- Parameters:
req- The HTTP requestrsp- The HTTP responser- A continuation that handles a git-upload-pack request.- Throws:
IOException- if an IO error occurred
-