| Modifier and Type | Field and Description |
|---|---|
| private final FileLfsRepository | |
| private static final long | |
| private final long |
| Access | Constructor and Description |
|---|---|
| public | FileLfsServlet(FileLfsRepository
the repository storing the large objects repository, long timeout for object upload / download in milliseconds timeout)Constructor for FileLfsServlet. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | doGet(HttpServletRequest
an req, HttpServletResponse HttpServletRequest object that contains the request the client has made of the servletan rsp)HttpServletResponse object that contains the response the servlet sends to the clientOverrides jakarta. Called by the server (via the |
| protected void | doPut(HttpServletRequest
the req, HttpServletResponse HttpServletRequest object that contains the request the client made of the servletthe rsp)HttpServletResponse object that contains the response the servlet returns to the clientOverrides jakarta. Called by the server (via the |
| protected AnyLongObjectId | Returns: object id, ornull if the object id could not be
retrievedservlet request req, HttpServletResponse servlet response rsp)Retrieve object id from request |
| protected static void | sendError(HttpServletResponse
the servlet response rsp, int HTTP status code status, String error message message)Send an error response. |
| repository | back to summary |
|---|---|
| private final FileLfsRepository repository | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| timeout | back to summary |
|---|---|
| private final long timeout | |
| FileLfsServlet | back to summary |
|---|---|
| public FileLfsServlet(FileLfsRepository repository, long timeout) Constructor for FileLfsServlet.
| |
| doGet | back to summary |
|---|---|
| protected void doGet(HttpServletRequest req, HttpServletResponse rsp) throws ServletException, IOException Overrides jakarta. Doc from jakarta. Called by the server (via the Overriding this method to support a GET request also automatically supports an HTTP HEAD request. A HEAD request is a GET request that returns no body in the response, only the request header fields.
When overriding this method, read the request data, write the response headers, get the response's writer or output
stream object, and finally, write the response data. It's best to include content type and encoding. When using a
The servlet container must write the headers before committing the response, because in HTTP the headers must be sent before the response body.
Where possible, set the Content-Length header (with the When using HTTP 1.1 chunked encoding (which means that the response has a Transfer-Encoding header), do not set the Content-Length header. The GET method should be safe, that is, without any side effects for which users are held responsible. For example, most form queries have no side effects. If a client request is intended to change stored data, the request should use some other HTTP method. The GET method should also be idempotent, meaning that it can be safely repeated. Sometimes making a method safe also makes it idempotent. For example, repeating queries is both safe and idempotent, but buying a product online or modifying data is neither safe nor idempotent.
If the request is incorrectly formatted,
| |
| doPut | back to summary |
|---|---|
| protected void doPut(HttpServletRequest req, HttpServletResponse rsp) throws ServletException, IOException Overrides jakarta. Doc from jakarta. Called by the server (via the When overriding this method, leave intact any content headers sent with the request (including Content-Length, Content-Type, Content-Transfer-Encoding, Content-Encoding, Content-Base, Content-Language, Content-Location, Content-MD5, and Content-Range). If your method cannot handle a content header, it must issue an error message (HTTP 501 - Not Implemented) and discard the request. For more information on HTTP 1.1 and the PUT method, see RFC 7231 .
This method does not need to be either safe or idempotent. Operations that
If the HTTP PUT request is incorrectly formatted,
| |
| getObjectToTransfer | back to summary |
|---|---|
| protected AnyLongObjectId getObjectToTransfer(HttpServletRequest req, HttpServletResponse rsp) throws IOException Retrieve object id from request
| |
| sendError | back to summary |
|---|---|
| protected static void sendError(HttpServletResponse rsp, int status, String message) throws IOException Send an error response.
| |