com.yworks.yfiles.server.graphml.servlets
Class UploadServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bycom.yworks.yfiles.server.graphml.servlets.UploadServlet
All Implemented Interfaces:
java.io.Serializable, Servlet, ServletConfig

public class UploadServlet
extends HttpServlet

Simple upload servlet that takes the request from a client and sends the content back in the response. This servlet expects "multipart/form-data" as sent from a call to flash.net.FileReference.upload or a com.yfiles.remote.UploadHandler.

See Also:
Serialized Form

Constructor Summary
UploadServlet()
          Calls the UploadServlet(String) constructor using AbstractGraphRoundtripSupport.PARAM_GRAPH as the parameter name.
UploadServlet(java.lang.String graphParameter)
          Creates a new instance using the provided parameter to get the graphml string from the HttpServletRequest.
 
Method Summary
protected  void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
           
protected  void doPost(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
           
protected  java.lang.String getContentType()
          Get the content type that will be used for the response header.
protected  java.util.HashMap parseMultipart(HttpServletRequest request)
          Parses the HttpServletRequest's InputStream for the parameters of a multipart/form-data encoded request.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, 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
 

Constructor Detail

UploadServlet

public UploadServlet()
Calls the UploadServlet(String) constructor using AbstractGraphRoundtripSupport.PARAM_GRAPH as the parameter name.


UploadServlet

public UploadServlet(java.lang.String graphParameter)
Creates a new instance using the provided parameter to get the graphml string from the HttpServletRequest.

Parameters:
graphParameter - the name of the parameter of null if the ServletInputStream shall be used.
Method Detail

doGet

protected void doGet(HttpServletRequest httpServletRequest,
                     HttpServletResponse httpServletResponse)
              throws java.io.IOException,
                     ServletException
Throws:
java.io.IOException
ServletException

getContentType

protected java.lang.String getContentType()
Get the content type that will be used for the response header.

Depending on the servlet container configuration, the response content type might determine whether the servlet container sends a compressed response.

Returns:
A conten MIME type. This implementation returns "text/xml".

doPost

protected void doPost(HttpServletRequest httpServletRequest,
                      HttpServletResponse httpServletResponse)
               throws ServletException,
                      java.io.IOException
Throws:
ServletException
java.io.IOException

parseMultipart

protected java.util.HashMap parseMultipart(HttpServletRequest request)
                                    throws java.io.IOException
Parses the HttpServletRequest's InputStream for the parameters of a multipart/form-data encoded request.

Parameters:
request - The request to parse.
Returns:
A HashMap with the parameter names as key and the content as value
Throws:
java.io.IOException


Copyright © 2000-2013 yWorks GmbH. All rights reserved