diff --git a/spring-web/src/main/java/org/springframework/http/HttpStatus.java b/spring-web/src/main/java/org/springframework/http/HttpStatus.java index 2c8646245d..ac65c21c7e 100644 --- a/spring-web/src/main/java/org/springframework/http/HttpStatus.java +++ b/spring-web/src/main/java/org/springframework/http/HttpStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. @@ -128,7 +128,7 @@ public enum HttpStatus { /** * {@code 302 Moved Temporarily}. * @see HTTP/1.0, section 9.3 - * @deprecated In favor of {@link #FOUND} which will be returned from {@code HttpStatus.valueOf(302)} + * @deprecated in favor of {@link #FOUND} which will be returned from {@code HttpStatus.valueOf(302)} */ @Deprecated MOVED_TEMPORARILY(302, "Moved Temporarily"), @@ -236,7 +236,7 @@ public enum HttpStatus { /** * {@code 413 Request Entity Too Large}. * @see HTTP/1.1, section 10.4.14 - * @deprecated In favor of {@link #PAYLOAD_TOO_LARGE} which will be returned from {@code HttpStatus.valueOf(413)} + * @deprecated in favor of {@link #PAYLOAD_TOO_LARGE} which will be returned from {@code HttpStatus.valueOf(413)} */ @Deprecated REQUEST_ENTITY_TOO_LARGE(413, "Request Entity Too Large"), @@ -249,7 +249,7 @@ public enum HttpStatus { /** * {@code 414 Request-URI Too Long}. * @see HTTP/1.1, section 10.4.15 - * @deprecated In favor of {@link #URI_TOO_LONG} which will be returned from {@code HttpStatus.valueOf(414)} + * @deprecated in favor of {@link #URI_TOO_LONG} which will be returned from {@code HttpStatus.valueOf(414)} */ @Deprecated REQUEST_URI_TOO_LONG(414, "Request-URI Too Long"), diff --git a/spring-web/src/main/java/org/springframework/web/multipart/support/StandardMultipartHttpServletRequest.java b/spring-web/src/main/java/org/springframework/web/multipart/support/StandardMultipartHttpServletRequest.java index a86f713e67..79783f9a3b 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/support/StandardMultipartHttpServletRequest.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/support/StandardMultipartHttpServletRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2017 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. @@ -107,15 +107,11 @@ public class StandardMultipartHttpServletRequest extends AbstractMultipartHttpSe } setMultipartFiles(files); } - catch (Exception ex) { + catch (Throwable ex) { throw new MultipartException("Could not parse multipart servlet request", ex); } } - private String extractFilename(String contentDisposition) { - return extractFilename(contentDisposition, FILENAME_KEY); - } - private String extractFilename(String contentDisposition, String key) { if (contentDisposition == null) { return null; @@ -140,6 +136,10 @@ public class StandardMultipartHttpServletRequest extends AbstractMultipartHttpSe return filename; } + private String extractFilename(String contentDisposition) { + return extractFilename(contentDisposition, FILENAME_KEY); + } + private String extractFilenameWithCharset(String contentDisposition) { String filename = extractFilename(contentDisposition, FILENAME_WITH_CHARSET_KEY); if (filename == null) { @@ -220,7 +220,7 @@ public class StandardMultipartHttpServletRequest extends AbstractMultipartHttpSe Part part = getPart(paramOrFileName); return (part != null ? part.getContentType() : null); } - catch (Exception ex) { + catch (Throwable ex) { throw new MultipartException("Could not access multipart servlet request", ex); } } @@ -240,7 +240,7 @@ public class StandardMultipartHttpServletRequest extends AbstractMultipartHttpSe return null; } } - catch (Exception ex) { + catch (Throwable ex) { throw new MultipartException("Could not access multipart servlet request", ex); } } diff --git a/spring-web/src/main/java/org/springframework/web/multipart/support/StandardServletMultipartResolver.java b/spring-web/src/main/java/org/springframework/web/multipart/support/StandardServletMultipartResolver.java index 91269a65c4..370d1c81cf 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/support/StandardServletMultipartResolver.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/support/StandardServletMultipartResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2017 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. @@ -42,6 +42,9 @@ import org.springframework.web.multipart.MultipartResolver; * * @author Juergen Hoeller * @since 3.1 + * @see #setResolveLazily + * @see HttpServletRequest#getParts() + * @see org.springframework.web.multipart.commons.CommonsMultipartResolver */ public class StandardServletMultipartResolver implements MultipartResolver { @@ -87,7 +90,7 @@ public class StandardServletMultipartResolver implements MultipartResolver { } } } - catch (Exception ex) { + catch (Throwable ex) { LogFactory.getLog(getClass()).warn("Failed to perform cleanup of multipart items", ex); } }