Package org.springframework.web.multipart

Examples of org.springframework.web.multipart.MultipartException


    try {
      Part part = getPart(paramOrFileName);
      return (part != null ? part.getContentType() : null);
    }
    catch (Exception ex) {
      throw new MultipartException("Could not access multipart servlet request", ex);
    }
  }
View Full Code Here


      else {
        return null;
      }
    }
    catch (Exception ex) {
      throw new MultipartException("Could not access multipart servlet request", ex);
    }
  }
View Full Code Here

  public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
      NativeWebRequest request, WebDataBinderFactory binderFactory) throws Exception {

    HttpServletRequest servletRequest = request.getNativeRequest(HttpServletRequest.class);
    if (!isMultipartRequest(servletRequest)) {
      throw new MultipartException("The current request is not a multipart request");
    }
   
    MultipartHttpServletRequest multipartRequest =
      WebUtils.getNativeRequest(servletRequest, MultipartHttpServletRequest.class);
View Full Code Here

    return arg;
  }

  private void assertIsMultipartRequest(HttpServletRequest request) {
    if (!isMultipartRequest(request)) {
      throw new MultipartException("The current request is not a multipart request.");
    }
  }
View Full Code Here

  }

  private static void assertIsMultipartRequest(HttpServletRequest request) {
    String contentType = request.getContentType();
    if (contentType == null || !contentType.toLowerCase().startsWith("multipart/")) {
      throw new MultipartException("The current request is not a multipart request");
    }
  }
View Full Code Here

    }
    catch (FileUploadBase.SizeLimitExceededException ex) {
      throw new MaxUploadSizeExceededException(fileUpload.getSizeMax(), ex);
    }
    catch (FileUploadException ex) {
      throw new MultipartException("Could not parse multipart servlet request", ex);
    }
  }
View Full Code Here

    }
    catch (FileUploadBase.SizeLimitExceededException ex) {
      throw new MaxUploadSizeExceededException(fileUpload.getSizeMax(), ex);
    }
    catch (FileUploadException ex) {
      throw new MultipartException("Could not parse multipart servlet request", ex);
    }
  }
View Full Code Here

    }
    catch (FileUploadBase.SizeLimitExceededException ex) {
      throw new MaxUploadSizeExceededException(fileUpload.getSizeMax(), ex);
    }
    catch (FileUploadException ex) {
      throw new MultipartException("Could not parse multipart portlet request", ex);
    }
  }
View Full Code Here

    }
    catch (FileUploadBase.SizeLimitExceededException ex) {
      throw new MaxUploadSizeExceededException(fileUpload.getSizeMax(), ex);
    }
    catch (FileUploadException ex) {
      throw new MultipartException("Could not parse multipart servlet request", ex);
    }
  }
View Full Code Here

      // so we need to check the error message here!
      if (ex.getMessage().indexOf("exceeds limit") != -1) {
        throw new MaxUploadSizeExceededException(this.maxUploadSize, ex);
      }
      else {
        throw new MultipartException("Could not parse multipart request", ex);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.web.multipart.MultipartException

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.