Package org.eclipse.jgit.lfs.server.fs
Class FileLfsServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.eclipse.jgit.lfs.server.fs.FileLfsServlet
-
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
@WebServlet(asyncSupported=true) public class FileLfsServlet extends javax.servlet.http.HttpServlet
Servlet supporting upload and download of large objects as defined by the GitHub Large File Storage extension API extending git to allow separate storage of large files (https://github.com/github/git-lfs/tree/master/docs/api).- Since:
- 4.3
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FileLfsServlet(FileLfsRepository repository, long timeout)
Constructor for FileLfsServlet.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp)
Handle object downloadsprotected void
doPut(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp)
Handle object uploadsprotected AnyLongObjectId
getObjectToTransfer(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp)
Retrieve object id from requestprotected static void
sendError(javax.servlet.http.HttpServletResponse rsp, int status, String message)
Send an error response.-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doTrace, getLastModified, service, service
-
-
-
-
Constructor Detail
-
FileLfsServlet
public FileLfsServlet(FileLfsRepository repository, long timeout)
Constructor for FileLfsServlet.
- Parameters:
repository
- the repository storing the large objectstimeout
- timeout for object upload / download in milliseconds
-
-
Method Detail
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp) throws javax.servlet.ServletException, IOException
Handle object downloads- Overrides:
doGet
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
getObjectToTransfer
protected AnyLongObjectId getObjectToTransfer(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp) throws IOException
Retrieve object id from request- Parameters:
req
- servlet requestrsp
- servlet response- Returns:
- object id, or
null
if the object id could not be retrieved - Throws:
IOException
- if an I/O error occurs- Since:
- 4.6
-
doPut
protected void doPut(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp) throws javax.servlet.ServletException, IOException
Handle object uploads- Overrides:
doPut
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
sendError
protected static void sendError(javax.servlet.http.HttpServletResponse rsp, int status, String message) throws IOException
Send an error response.- Parameters:
rsp
- the servlet responsestatus
- HTTP status codemessage
- error message- Throws:
IOException
- on failure to send the response- Since:
- 4.6
-
-