abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r574656 - /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
Date Tue, 11 Sep 2007 18:11:30 GMT
Author: jmsnell
Date: Tue Sep 11 11:11:29 2007
New Revision: 574656

URL: http://svn.apache.org/viewvc?rev=574656&view=rev
Log:
entry.setContent(dataHandler,mediaType) was not working correctly.  The passed in media type
was being dropped.

Modified:
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java?rev=574656&r1=574655&r2=574656&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
Tue Sep 11 11:11:29 2007
@@ -253,15 +253,12 @@
    * @throws MimeTypeParseException 
    */
   public Content setContent(DataHandler dataHandler, String mediatype) {
-    try {
-      FOMFactory factory = (FOMFactory) this.factory;
-      Content content = factory.newContent(new MimeType(mediatype));
-      content.setDataHandler(dataHandler);
-      setContentElement(content);
-      return content;
-    } catch (javax.activation.MimeTypeParseException e) {
-      throw new org.apache.abdera.util.MimeTypeParseException(e);
-    }
+    FOMFactory factory = (FOMFactory) this.factory;
+    Content content = factory.newContent(Content.Type.MEDIA);
+    content.setDataHandler(dataHandler);
+    if (mediatype != null) content.setMimeType(mediatype);
+    setContentElement(content);
+    return content;
   }
   
   /**



Mime
View raw message