Author: ay Date: Thu Aug 16 09:51:57 2012 New Revision: 1373771 URL: http://svn.apache.org/viewvc?rev=1373771&view=rev Log: Merged revisions 1373663 via svn merge from https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes
........ r1373663 | ay | 2012-08-16 00:40:27 +0200 (Thu, 16 Aug 2012) | 9 lines Merged revisions 1373661 via svn merge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1373661 | ay | 2012-08-16 00:36:37 +0200 (Thu, 16 Aug 2012) | 1 line [CXF-4476] Content-Disposition header may be incorrectly set in MTOM under windows ........ ........ Modified: cxf/branches/2.5.x-fixes/ (props changed) cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java Propchange: cxf/branches/2.5.x-fixes/ ('svn:mergeinfo' removed) Propchange: cxf/branches/2.5.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java?rev=1373771&r1=1373770&r2=1373771&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java (original) +++ cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java Thu Aug 16 09:51:57 2012 @@ -342,8 +342,9 @@ public final class AttachmentUtil { if (!StringUtils.isEmpty(handler.getName())) { //set Content-Disposition attachment header if filename isn't null String file = handler.getName(); - if (StringUtils.isFileExist(file)) { - file = file.substring(file.lastIndexOf(File.separator) + 1); + File f = new File(file); + if (f.exists() && f.isFile()) { + file = f.getName(); } att.setHeader("Content-Disposition", "attachment;name=\"" + file + "\""); }
