From 7ea85a959c810c1689fc04b8d0c2bd17e5fe6e08 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sun, 27 May 2012 23:57:47 +0200 Subject: [PATCH] Fix MultipartResolver Resin compatibility StandardServletMultipartResolver#cleanupMultipart now takes care to delete only actual file parts for Resin compatibility. Issue: SPR-9299 --- .../support/StandardServletMultipartResolver.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 7356345aea..bbbf63b5b1 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-2011 the original author or authors. + * Copyright 2002-2012 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. @@ -59,10 +59,13 @@ public class StandardServletMultipartResolver implements MultipartResolver { } public void cleanupMultipart(MultipartHttpServletRequest request) { - // To be on the safe side: explicitly delete all parts. + // To be on the safe side: explicitly delete the parts, + // but only actual file parts (for Resin compatibility) try { for (Part part : request.getParts()) { - part.delete(); + if (request.getFile(part.getName()) != null) { + part.delete(); + } } } catch (Exception ex) {