Author: ay
Date: Wed Aug 15 22:40:27 2012
New Revision: 1373663
URL: http://svn.apache.org/viewvc?rev=1373663&view=rev
Log:
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.6.x-fixes/ (props changed)
cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java?rev=1373663&r1=1373662&r2=1373663&view=diff
==============================================================================
---
cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
(original)
+++
cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
Wed Aug 15 22:40:27 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 +
"\"");
}