Package jodd.servlet.upload

Examples of jodd.servlet.upload.MultipartRequestWrapper


    // multipart
    if ((servletRequest instanceof MultipartRequestWrapper) == false) {
      return;
    }
    MultipartRequestWrapper multipartRequest = (MultipartRequestWrapper) servletRequest;
    if (multipartRequest.isMultipart() == false) {
      return;
    }
    paramNames = multipartRequest.getFileParameterNames();
    while (paramNames.hasMoreElements()) {
      String paramName = (String) paramNames.nextElement();
      if (servletRequest.getAttribute(paramName) != null) {
        continue;
      }
      FileUpload[] paramValues = multipartRequest.getFiles(paramName);
      servletRequest.setAttribute(paramName, paramValues.length == 1 ? paramValues[0] : paramValues);
    }
  }
View Full Code Here


   */
  protected void injectUploadedFiles(Object[] targets, ScopeData.In[][] injectData, HttpServletRequest servletRequest) {
    if ((servletRequest instanceof MultipartRequestWrapper) == false) {
      return;
    }
    MultipartRequestWrapper multipartRequest = (MultipartRequestWrapper) servletRequest;
    if (multipartRequest.isMultipart() == false) {
      return;
    }
    Enumeration paramNames = multipartRequest.getFileParameterNames();
    while (paramNames.hasMoreElements()) {
      String paramName = (String) paramNames.nextElement();
      if (servletRequest.getAttribute(paramName) != null) {
        continue;
      }

      for (int i = 0; i < targets.length; i++) {
        Object target = targets[i];
        ScopeData.In[] scopes = injectData[i];
        if (scopes == null) {
          continue;
        }

        for (ScopeData.In in : scopes) {
          String name = getMatchedPropertyName(in, paramName);
          if (name != null) {
            FileUpload[] paramValues = multipartRequest.getFiles(paramName);

            if (config.ignoreInvalidUploadFiles) {
              for (int j = 0; j < paramValues.length; j++) {
                FileUpload paramValue = paramValues[j];

View Full Code Here

  public Object intercept(ActionRequest actionRequest) throws Exception {
    HttpServletRequest servletRequest = actionRequest.getHttpServletRequest();

    // detect multipart request
    if (ServletUtil.isMultipartRequest(servletRequest)) {
      servletRequest = new MultipartRequestWrapper(servletRequest, madvocConfig.getFileUploadFactory(), madvocConfig.getEncoding());
      actionRequest.setHttpServletRequest(servletRequest);
    }

    // do it
    inject(actionRequest);
View Full Code Here

   */
  protected void injectUploadedFiles(Target[] targets, ScopeData[] injectData, HttpServletRequest servletRequest) {
    if ((servletRequest instanceof MultipartRequestWrapper) == false) {
      return;
    }
    MultipartRequestWrapper multipartRequest = (MultipartRequestWrapper) servletRequest;
    if (multipartRequest.isMultipart() == false) {
      return;
    }
    Enumeration paramNames = multipartRequest.getFileParameterNames();
    while (paramNames.hasMoreElements()) {
      String paramName = (String) paramNames.nextElement();
      if (servletRequest.getAttribute(paramName) != null) {
        continue;
      }

      for (int i = 0; i < targets.length; i++) {
        Target target = targets[i];
        if (injectData[i] == null) {
          continue;
        }
        ScopeData.In[] scopes = injectData[i].in;
        if (scopes == null) {
          continue;
        }

        for (ScopeData.In in : scopes) {
          String name = getMatchedPropertyName(in, paramName);
          if (name != null) {
            FileUpload[] paramValues = multipartRequest.getFiles(paramName);

            if (ignoreInvalidUploadFiles) {
              for (int j = 0; j < paramValues.length; j++) {
                FileUpload paramValue = paramValues[j];

View Full Code Here

    // multipart
    if ((servletRequest instanceof MultipartRequestWrapper) == false) {
      return;
    }
    MultipartRequestWrapper multipartRequest = (MultipartRequestWrapper) servletRequest;
    if (multipartRequest.isMultipart() == false) {
      return;
    }
    paramNames = multipartRequest.getFileParameterNames();
    while (paramNames.hasMoreElements()) {
      String paramName = (String) paramNames.nextElement();
      if (servletRequest.getAttribute(paramName) != null) {
        continue;
      }
      FileUpload[] paramValues = multipartRequest.getFiles(paramName);
      servletRequest.setAttribute(paramName, paramValues.length == 1 ? paramValues[0] : paramValues);
    }
  }
View Full Code Here

TOP

Related Classes of jodd.servlet.upload.MultipartRequestWrapper

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.