org.apache.geronimo.deployment.remote
Class FileUploadServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
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
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 |
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
FileUploadServlet
public FileUploadServlet()
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.