org.hd.d.pg2k.webSvr.upload
Class UploadServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.hd.d.pg2k.webSvr.upload.UploadServlet
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
public final class UploadServlet
- extends javax.servlet.http.HttpServlet
This is the servlet that accepts uploads from non-browser sources.
This is used by the JWS-based uploader.
This should coexist with the HTML/JSP/browser-based uploader,
and respect at least the same security and safety restrictions.
This will respond only to POST requests for efficiency and security.
The general form of the protocol for upload is:
- The client sends authentication credentials.
- The server sends a reject and drops the connection,
else an OK
[and the current space available]
[and the hashes of all items in the upload area].
- The client then sends, one per exhibit:
- The full proposed exhibit name.
- The exhibit hash.
- The exhibit description, if any.
- The exhibit data.
- The server responds with an OK
(naming the accepted exhibit to avoid ambiguity)
or reject, dropping the connection.
- If the connection remains idle too long,
or for any other reason,
the server may asynchronously send a "reject" and drop the connection.
- The client, when it has no more to upload,
may send a "close" request, wait for a response,
and then drop the connection.
- See Also:
- Serialized Form
|
Field Summary |
private static long |
serialVersionUID
Unique Serialisation class ID generated by http://random.hd.org/. |
|
Method Summary |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Respond to a POST request for the content served by this servlet. |
private static DataSourceBean |
getDataSource(javax.servlet.ServletConfig config,
javax.servlet.http.HttpServletRequest request)
Get singleton (per-servlet-context) data pipeline/cache instance. |
| Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- Unique Serialisation class ID generated by http://random.hd.org/.
- See Also:
- Constant Field Values
UploadServlet
public UploadServlet()
getDataSource
private static DataSourceBean getDataSource(javax.servlet.ServletConfig config,
javax.servlet.http.HttpServletRequest request)
- Get singleton (per-servlet-context) data pipeline/cache instance.
The config parameter must not be null, but for some operations
(such as calling destroy()) request can be null.
doPost
public void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException
- Respond to a POST request for the content served by this servlet.
- Overrides:
doPost in class javax.servlet.http.HttpServlet
- Parameters:
request - The servlet request we are processingresponse - The servlet response we are producing
- Throws:
java.io.IOException - if an input/output error occurs
Copyright (c) 1996-2011, Damon Hart-Davis. All rights reserved.