You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2011/03/16 16:59:03 UTC

svn commit: r1082179 - /chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java

Author: fmui
Date: Wed Mar 16 15:59:03 2011
New Revision: 1082179

URL: http://svn.apache.org/viewvc?rev=1082179&view=rev
Log:
don't try to set a Content-Disposition header if there is no filename

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java?rev=1082179&r1=1082178&r2=1082179&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java Wed Mar 16 15:59:03 2011
@@ -65,8 +65,6 @@ import org.apache.chemistry.opencmis.com
 
 /**
  * Object Service AtomPub client.
- *
- * @author <a href="mailto:fmueller@opentext.com">Florian M&uuml;ller</a>
  */
 public class ObjectServiceImpl extends AbstractAtomPubService implements ObjectService {
 
@@ -526,11 +524,14 @@ public class ObjectServiceImpl extends A
         final InputStream stream = contentStream.getStream();
 
         // Content-Disposition header for the filename
-        Map<String, String> headers = Collections.singletonMap(
-                MimeHelper.CONTENT_DISPOSITION,
-                MimeHelper.encodeContentDisposition(
-                        MimeHelper.DISPOSITION_ATTACHMENT,
-                        contentStream.getFileName()));
+        Map<String, String> headers = null;
+        if (contentStream.getFileName() != null) {
+            headers = Collections
+                    .singletonMap(
+                            MimeHelper.CONTENT_DISPOSITION,
+                            MimeHelper.encodeContentDisposition(MimeHelper.DISPOSITION_ATTACHMENT,
+                                    contentStream.getFileName()));
+        }
 
         // send content
         HttpUtils.Response resp = put(url, contentStream.getMimeType(), headers, new HttpUtils.Output() {