org.hd.d.pg2k.webSvr.upload
Class UploadServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by 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:

  1. The client sends authentication credentials.
  2. 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].
  3. The client then sends, one per exhibit:
  4. The server responds with an OK (naming the accepted exhibit to avoid ambiguity) or reject, dropping the connection.
  5. If the connection remains idle too long, or for any other reason, the server may asynchronously send a "reject" and drop the connection.
  6. 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/.
 
Constructor Summary
UploadServlet()
           
 
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
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Unique Serialisation class ID generated by http://random.hd.org/.

See Also:
Constant Field Values
Constructor Detail

UploadServlet

public UploadServlet()
Method Detail

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 processing
response - The servlet response we are producing
Throws:
java.io.IOException - if an input/output error occurs

DHD Multimedia Gallery V1.57.21

Copyright (c) 1996-2011, Damon Hart-Davis. All rights reserved.