@WebServlet(asyncSupported=true)
public class FileLfsServlet
extends javax.servlet.http.HttpServlet
Constructor and Description |
---|
FileLfsServlet(FileLfsRepository repository,
long timeout) |
Modifier and Type | Method and Description |
---|---|
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse rsp)
Handles object downloads
|
protected void |
doPut(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse rsp)
Handle object uploads
|
protected AnyLongObjectId |
getObjectToTransfer(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse rsp)
Retrieve object id from request
|
protected static void |
sendError(javax.servlet.http.HttpServletResponse rsp,
int status,
String message)
Send an error response.
|
doDelete, doHead, doOptions, doPost, doTrace, getLastModified, service, service
public FileLfsServlet(FileLfsRepository repository, long timeout)
repository
- the repository storing the large objectstimeout
- timeout for object upload / download in millisecondsprotected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp) throws javax.servlet.ServletException, IOException
doGet
in class javax.servlet.http.HttpServlet
req
- servlet requestrsp
- servlet responsejavax.servlet.ServletException
- if a servlet-specific error occursIOException
- if an I/O error occursprotected AnyLongObjectId getObjectToTransfer(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp) throws IOException
req
- servlet requestrsp
- servlet responsenull
if the object id could not be
retrievedIOException
- if an I/O error occursprotected void doPut(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp) throws javax.servlet.ServletException, IOException
doPut
in class javax.servlet.http.HttpServlet
req
- servlet requestrsp
- servlet responsejavax.servlet.ServletException
- if a servlet-specific error occursIOException
- if an I/O error occursprotected static void sendError(javax.servlet.http.HttpServletResponse rsp, int status, String message) throws IOException
rsp
- the servlet responsestatus
- HTTP status codemessage
- error messageIOException
- on failure to send the responseCopyright © 2017 Eclipse JGit Project. All rights reserved.