org.apache.geronimo.deployment.remote
Class FileUploadServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.apache.geronimo.deployment.remote.FileUploadServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class FileUploadServlet
extends HttpServlet

A servlet that accepts file uploads. It takes only POST requests, which should contain a Java "DataOutput" formatted stream from RemoteDeployUtil containing: RemoteDeployer data stream format: 0) an int, the version of this datastream format - REMOTE_DEPLOY_REQUEST_VER 1) an int, the number of files being uploaded 2) for each file: 2.0) a UTF String, the filename of the file being uploaded 2.1) a long, the length of the file in bytes 2.2) byte[], byte count equal to the number above for the file RemoteDeployer response stream format: It returns a serialized stream containing: 0) an int, the version of this datastream format - REMOTE_DEPLOY_RESPONSE_VER 1) a UTF string, the status (should be "OK") 2) an int, the number of files received 3) for each file: 3.1) a UTF String, the path to the file as saved to the server's filesystem The file positions in the response will be the same as in the request. That is, a name for upload file #2 will be in response position #2.

See Also:
Serialized Form

Field Summary
static int REMOTE_DEPLOY_REQUEST_VER
           
static int REMOTE_DEPLOY_REQUEST_VER_0
          Note: The below versions should be kept in sync with those in RemoteDeployUtil.java
static int REMOTE_DEPLOY_RESPONSE_VER
           
static int REMOTE_DEPLOY_RESPONSE_VER_0
           
 
Constructor Summary
FileUploadServlet()
           
 
Method Summary
protected  void doPost(HttpServletRequest request, HttpServletResponse response)
           
 
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

REMOTE_DEPLOY_REQUEST_VER_0

public static final int REMOTE_DEPLOY_REQUEST_VER_0
Note: The below versions should be kept in sync with those in RemoteDeployUtil.java

See Also:
Constant Field Values

REMOTE_DEPLOY_RESPONSE_VER_0

public static final int REMOTE_DEPLOY_RESPONSE_VER_0
See Also:
Constant Field Values

REMOTE_DEPLOY_REQUEST_VER

public static final int REMOTE_DEPLOY_REQUEST_VER
See Also:
Constant Field Values

REMOTE_DEPLOY_RESPONSE_VER

public static final int REMOTE_DEPLOY_RESPONSE_VER
See Also:
Constant Field Values
Constructor Detail

FileUploadServlet

public FileUploadServlet()
Method Detail

doPost

protected void doPost(HttpServletRequest request,
                      HttpServletResponse response)
               throws ServletException,
                      IOException
Overrides:
doPost in class HttpServlet
Throws:
ServletException
IOException


Copyright © 2003-2008 The Apache Geronimo development community. All Rights Reserved.