You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ay...@apache.org on 2012/08/16 11:57:37 UTC
svn commit: r1373772 - in /cxf/branches/2.4.x-fixes: ./
rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
Author: ay
Date: Thu Aug 16 09:57:37 2012
New Revision: 1373772
URL: http://svn.apache.org/viewvc?rev=1373772&view=rev
Log:
Merged revisions 1373771 via svn merge from
https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes
........
r1373771 | ay | 2012-08-16 11:51:57 +0200 (Thu, 16 Aug 2012) | 17 lines
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.4.x-fixes/ (props changed)
cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
Propchange: cxf/branches/2.4.x-fixes/
('svn:mergeinfo' removed)
Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java?rev=1373772&r1=1373771&r2=1373772&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java (original)
+++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java Thu Aug 16 09:57:37 2012
@@ -309,8 +309,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 + "\"");
}