Skip to content

Commit

Permalink
fixed StandardServletMultipartResolver compatibility with Resin (SPR-…
Browse files Browse the repository at this point in the history
…9299)
  • Loading branch information
jhoeller committed May 27, 2012
1 parent 8cdfbfe commit 9fcb578
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -59,10 +59,13 @@ public MultipartHttpServletRequest resolveMultipart(HttpServletRequest request)
}

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) {
Expand Down

0 comments on commit 9fcb578

Please sign in to comment.