abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r442999 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/model/Entry.java parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
Date Wed, 13 Sep 2006 15:25:13 GMT
Author: jmsnell
Date: Wed Sep 13 08:25:12 2006
New Revision: 442999

URL: http://svn.apache.org/viewvc?view=rev&rev=442999
Log:
For Media Link Entries, it is very helpful to have an easier way of getting to the 
media type of <content type="..." src="..." /> style content elements.  Adds a 
getContentMimeType() method

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

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java?view=diff&rev=442999&r1=442998&r2=442999
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java Wed
Sep 13 08:25:12 2006
@@ -23,6 +23,7 @@
 import java.util.List;
 
 import javax.activation.DataHandler;
+import javax.activation.MimeType;
 import javax.activation.MimeTypeParseException;
 
 /**
@@ -239,6 +240,12 @@
    * Returns the content type
    */
   Content.Type getContentType();
+  
+  /**
+   * Returns the media type of the content type or null if type equals 'text',
+   * 'html' or 'xhtml'
+   */
+  MimeType getContentMimeType();
   
   /**
    * Lists the complete set of contributors for this entry

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?view=diff&rev=442999&r1=442998&r2=442999
==============================================================================
--- 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
Wed Sep 13 08:25:12 2006
@@ -743,4 +743,8 @@
     return (text != null) ? text.getTextType() : null;
   }
 
+  public MimeType getContentMimeType() {
+    Content content = getContentElement();
+    return (content != null) ? content.getMimeType() : null;
+  }
 }



Mime
View raw message