abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r574657 - /incubator/abdera/java/branches/0.3.0-incubating/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
Date Tue, 11 Sep 2007 18:12:49 GMT
Author: jmsnell
Date: Tue Sep 11 11:12:49 2007
New Revision: 574657

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

Modified:
    incubator/abdera/java/branches/0.3.0-incubating/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java

Modified: incubator/abdera/java/branches/0.3.0-incubating/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/branches/0.3.0-incubating/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java?rev=574657&r1=574656&r2=574657&view=diff
==============================================================================
--- incubator/abdera/java/branches/0.3.0-incubating/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
(original)
+++ incubator/abdera/java/branches/0.3.0-incubating/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
Tue Sep 11 11:12:49 2007
@@ -42,6 +42,7 @@
 import org.apache.abdera.model.Source;
 import org.apache.abdera.model.Text;
 import org.apache.abdera.model.Content.Type;
+import org.apache.abdera.parser.stax.FOMFactory;
 import org.apache.abdera.parser.stax.util.FOMHelper;
 import org.apache.abdera.util.Constants;
 import org.apache.abdera.util.URIHelper;
@@ -253,15 +254,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