Examples of GaeMultiPartRequestWrapper


Examples of com.struts2.gae.dispatcher.multipart.GaeMultiPartRequestWrapper

    String content_type = request.getContentType();
    if (content_type != null
        && content_type.indexOf("multipart/form-data") != -1) {
      GaeMultiPartRequest multi = getContainer().inject(
          GaeMultiPartRequest.class);
      request = new GaeMultiPartRequestWrapper(multi, request);
    } else {
      request = new StrutsRequestWrapper(request);
    }

    return request;
View Full Code Here

Examples of com.struts2.gae.dispatcher.multipart.GaeMultiPartRequestWrapper

    if (action instanceof ValidationAware) {
      validation = (ValidationAware) action;
    }

    GaeMultiPartRequestWrapper multiWrapper = (GaeMultiPartRequestWrapper) request;

    if (multiWrapper.hasErrors()) {
      for (String error : multiWrapper.getErrors()) {
        if (validation != null) {
          validation.addActionError(error);
        }

        LOG.error(error);
      }
    }

    // bind allowed Files
    Enumeration<String> fileParameterNames = multiWrapper
        .getFileParameterNames();
    while (fileParameterNames != null
        && fileParameterNames.hasMoreElements()) {
      // get the value of this input tag
      String inputName = fileParameterNames.nextElement();

      // get the content type
      String[] contentType = multiWrapper.getContentTypes(inputName);

      if (isNonEmpty(contentType)) {
        // get the name of the file from the input tag
        String[] fileName = multiWrapper.getFileNames(inputName);

        if (isNonEmpty(fileName)) {

          String[] fileItemStreams = multiWrapper
              .getFileContents(inputName);
          // get a File object for the uploaded File
          if (fileItemStreams != null && fileItemStreams.length > 0) {
            List<String> acceptedFiles = new ArrayList<String>(
                fileItemStreams.length);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.