cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1373661 - /cxf/trunk/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
Date Wed, 15 Aug 2012 22:36:38 GMT
Author: ay
Date: Wed Aug 15 22:36:37 2012
New Revision: 1373661

URL: http://svn.apache.org/viewvc?rev=1373661&view=rev
Log:
[CXF-4476] Content-Disposition header may be incorrectly set in MTOM under windows

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java?rev=1373661&r1=1373660&r2=1373661&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java Wed Aug 15 22:36:37
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 + "\"");
         }



Mime
View raw message