Browse Source

CommonsMultipartResolver explicitly converts FileSizeLimitExceededException

Issue: SPR-14638
(cherry picked from commit 58ffca7)
pull/1177/head
Juergen Hoeller 10 years ago
parent
commit
05f74b4218
  1. 7
      spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartResolver.java
  2. 7
      spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/multipart/CommonsPortletMultipartResolver.java

7
spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartResolver.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -161,8 +161,11 @@ public class CommonsMultipartResolver extends CommonsFileUploadSupport @@ -161,8 +161,11 @@ public class CommonsMultipartResolver extends CommonsFileUploadSupport
catch (FileUploadBase.SizeLimitExceededException ex) {
throw new MaxUploadSizeExceededException(fileUpload.getSizeMax(), ex);
}
catch (FileUploadBase.FileSizeLimitExceededException ex) {
throw new MaxUploadSizeExceededException(fileUpload.getFileSizeMax(), ex);
}
catch (FileUploadException ex) {
throw new MultipartException("Could not parse multipart servlet request", ex);
throw new MultipartException("Failed to parse multipart servlet request", ex);
}
}

7
spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/multipart/CommonsPortletMultipartResolver.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -156,8 +156,11 @@ public class CommonsPortletMultipartResolver extends CommonsFileUploadSupport @@ -156,8 +156,11 @@ public class CommonsPortletMultipartResolver extends CommonsFileUploadSupport
catch (FileUploadBase.SizeLimitExceededException ex) {
throw new MaxUploadSizeExceededException(fileUpload.getSizeMax(), ex);
}
catch (FileUploadBase.FileSizeLimitExceededException ex) {
throw new MaxUploadSizeExceededException(fileUpload.getFileSizeMax(), ex);
}
catch (FileUploadException ex) {
throw new MultipartException("Could not parse multipart portlet request", ex);
throw new MultipartException("Failed to parse multipart portlet request", ex);
}
}

Loading…
Cancel
Save