Package org.apache.commons.fileupload.servlet

Examples of org.apache.commons.fileupload.servlet.ServletRequestContext


            getContainerParameters(parameters);

            // only read input in case of multipart-POST not handled
            // by the servlet container
            if ("POST".equals(this.getServletRequest().getMethod())) {
                if (ServletFileUpload.isMultipartContent(new ServletRequestContext(
                    this.getServletRequest()))) {
                    this.parseMultiPartPost(parameters);
                    this.requestDataUsed = true;
                }
            }
View Full Code Here


        // Create a new file upload handler
        ServletFileUpload upload = new ServletFileUpload(factory);
        upload.setSizeMax(-1);

        RequestContext rc = new ServletRequestContext(this.getServletRequest()) {
            public String getCharacterEncoding() {
                String enc = super.getCharacterEncoding();
                return (enc != null) ? enc : Util.ENCODING_DIRECT;
            }
        };
View Full Code Here

    }
    if (params.size() > 0) {
      action = (String) params.get(0);
    }
    if (ServletFileUpload
        .isMultipartContent(new ServletRequestContext(req))) {
      FileItemFactory factory = new DiskFileItemFactory();
      ServletFileUpload upload = new ServletFileUpload(factory);
      try {
        multipartItems = upload.parseRequest(req);
      } catch (FileUploadException e) {
View Full Code Here

  public String[] getParameterValues(ParameterName paramName) {
    String[] values = null;

    if (ServletFileUpload
        .isMultipartContent(new ServletRequestContext(req))) {
      List<String> valueList = new ArrayList<String>();
      for (FileItem item : multipartItems) {
        if (item.isFormField()
            && item.getFieldName().equals(paramName.toString())) {
          valueList.add(item.getString());
View Full Code Here

    for (Entry<String, String[]> entry : parameterMap.entrySet()) {
      requestElement.appendChild(new HttpParameter(new ParameterName(
          entry.getKey()), entry.getValue()).toXml(doc));
    }
    if (ServletFileUpload
        .isMultipartContent(new ServletRequestContext(req))) {
      for (FileItem item : multipartItems) {
        requestElement.appendChild(new HttpParameter(new ParameterName(
            item.getFieldName()), item.isFormField() ? item
            .getString() : item.getName()).toXml(doc));
      }
View Full Code Here

    /**
     * Will intercept the request if apache file upload says that this request is multipart
     */
    public boolean accepts(ResourceMethod method) {
        return FileUploadBase.isMultipartContent(new ServletRequestContext(request));
    }
View Full Code Here

  public MultPartForm(final HttpServletRequest request) throws FileUploadException {
    Assert.notNull(request, "request");
    this.parameters = new HashMap<String, String>();
    this.files = new HashMap<String, FileItem>();

    RequestContext requestContext = new ServletRequestContext(request);

    if (FileUploadBase.isMultipartContent(requestContext)) {
      List<?> items = MultPartForm.upload.parseRequest(requestContext);
      Iterator<?> i = items.iterator();
      while (i.hasNext()) {
View Full Code Here

    }
  }

  public static String getParameter(final HttpServletRequest request, final String parameter) throws FileUploadException {
    String value = null;
    RequestContext requestContext = new ServletRequestContext(request);

    if (FileUploadBase.isMultipartContent(requestContext)) {
      List<?> items = MultPartForm.upload.parseRequest(requestContext);
      Iterator<?> i = items.iterator();
      while (i.hasNext()) {
View Full Code Here

    return value;
  }

  public static InputStream getFile(final HttpServletRequest request, final String parameter) throws FileUploadException, IOException {
    InputStream value = null;
    RequestContext requestContext = new ServletRequestContext(request);

    if (FileUploadBase.isMultipartContent(requestContext)) {
      List<?> items = MultPartForm.upload.parseRequest(requestContext);
      Iterator<?> i = items.iterator();
      while (i.hasNext()) {
View Full Code Here

        String hasHotUpdate =
                (String) configContext.getAxisConfiguration().getParameterValue("hotupdate");
        req.setAttribute("hotDeployment", (hasHotDeployment.equals("true")) ? "enabled"
                : "disabled");
        req.setAttribute("hotUpdate", (hasHotUpdate.equals("true")) ? "enabled" : "disabled");
        RequestContext reqContext = new ServletRequestContext(req);

        boolean isMultipart = ServletFileUpload.isMultipartContent(reqContext);
        if (isMultipart) {

            try {
View Full Code Here

TOP

Related Classes of org.apache.commons.fileupload.servlet.ServletRequestContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.