Package org.eclipse.jgit.lfs.server
Class LfsProtocolServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.eclipse.jgit.lfs.server.LfsProtocolServlet
-
- All Implemented Interfaces:
java.io.Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public abstract class LfsProtocolServlet extends javax.servlet.http.HttpServletLFS protocol handler implementing the LFS batch API [1] [1] https://github.com/github/git-lfs/blob/master/docs/api/v1/http-v1-batch.md- Since:
- 4.3
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classLfsProtocolServlet.LfsRequestLFS request.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringCONTENTTYPE_VND_GIT_LFS_JSONprivate static org.slf4j.LoggerLOGprivate static intSC_BANDWIDTH_LIMIT_EXCEEDEDprivate static intSC_RATE_LIMIT_EXCEEDEDprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description LfsProtocolServlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voiddoPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)protected abstract LargeFileRepositorygetLargeFileRepository(LfsProtocolServlet.LfsRequest request, java.lang.String path, java.lang.String auth)Get the large file repository for the given request and path.private voidsendError(javax.servlet.http.HttpServletResponse rsp, java.io.Writer writer, int status, java.lang.String message)-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
CONTENTTYPE_VND_GIT_LFS_JSON
private static final java.lang.String CONTENTTYPE_VND_GIT_LFS_JSON
- See Also:
- Constant Field Values
-
SC_RATE_LIMIT_EXCEEDED
private static final int SC_RATE_LIMIT_EXCEEDED
- See Also:
- Constant Field Values
-
SC_BANDWIDTH_LIMIT_EXCEEDED
private static final int SC_BANDWIDTH_LIMIT_EXCEEDED
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLargeFileRepository
protected abstract LargeFileRepository getLargeFileRepository(LfsProtocolServlet.LfsRequest request, java.lang.String path, java.lang.String auth) throws LfsException
Get the large file repository for the given request and path.- Parameters:
request- the requestpath- the pathauth- the Authorization HTTP header- Returns:
- the large file repository storing large files.
- Throws:
LfsException- implementations should throw more specific exceptions to signal which type of error occurred:LfsValidationError- when there is a validation error with one or more of the objects in the request
LfsRepositoryNotFound- when the repository does not exist for the user
LfsRepositoryReadOnly- when the user has read, but not write access. Only applicable when the operation in the request is "upload"
LfsRateLimitExceeded- when the user has hit a rate limit with the server
LfsBandwidthLimitExceeded- when the bandwidth limit for the user or repository has been exceeded
LfsInsufficientStorage- when there is insufficient storage on the server
LfsUnavailable- when LFS is not available
LfsException- when an unexpected internal server error occurred
- Since:
- 4.7
-
doPost
protected void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, java.io.IOException- Overrides:
doPostin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionjava.io.IOException
-
sendError
private void sendError(javax.servlet.http.HttpServletResponse rsp, java.io.Writer writer, int status, java.lang.String message)
-
-