Class UploadChunkServlet
- All Implemented Interfaces:
Servlet, ServletConfig, Serializable
POST /iizi-upload/<rid>/<fid> with the per-file secret in the X-iizi-upload header, the protocol fields in the query string (o offset, u plain length, c chunk index, last, q) and the chunk as the raw body.The request identifies nothing about the session: the reservation ID resolves in the server-global registry, which holds the application session. No cookie, no session ID, no remote-address binding. Strictly one chunk in flight per reservation (409 busy otherwise). The body is streamed to the part in 64 KiB buffers and never materialized whole. The secret is never logged.
Status codes: 404 unknown reservation or file (a reservation cancelled as a whole leaves the registry at once and is therefore 404, not 410); 401 wrong secret; 410 a cancelled, failed or refused file of a live reservation; 409 offset mismatch ({"o":hwm}), busy, or already complete; 423 a file the App holds paused ("paused":true, never a failure: the client waits for the App's resume); 413 chunk or file over its cap (the file fails); 400 malformed query; 200 {"o":newHwm,"done":bool}. A chunk for a file only the client had paused is that client's resume and is accepted.
- Author:
- Christopher Mindus
- See Also:
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSlack allowed above the chunk size for the compressed body of one chunk.static final StringThe secret header.static final StringThe servlet path specification.static final StringThe URL prefix.Fields inherited from class HttpServlet
LEGACY_DO_HEADConstructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionprotected voiddoOptions(HttpServletRequest request, HttpServletResponse response) protected voiddoPost(HttpServletRequest request, HttpServletResponse response) Methods inherited from class HttpServlet
doDelete, doGet, doHead, doPatch, doPut, doTrace, getLastModified, init, isSensitiveHeader, service, serviceMethods inherited from class GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
Field Details
PATH_SPEC
PREFIX
HEADER_SECRET
CHUNK_SLACK
public static final int CHUNK_SLACKSlack allowed above the chunk size for the compressed body of one chunk.- See Also:
Constructor Details
UploadChunkServlet
Constructor.- Parameters:
module- The module holding the registry and the store.- Throws:
NullPointerException- If the module is null.
Method Details
doOptions
- Overrides:
doOptionsin classHttpServlet
doPost
- Overrides:
doPostin classHttpServlet- Throws:
IOException