incubator-droids-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1441440 - /incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/ContentEntity.java
Date Fri, 01 Feb 2013 13:29:54 GMT
Author: tobr
Date: Fri Feb  1 13:29:54 2013
New Revision: 1441440

URL: http://svn.apache.org/viewvc?rev=1441440&view=rev
Log:
added charset

Modified:
    incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/ContentEntity.java

Modified: incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/ContentEntity.java
URL: http://svn.apache.org/viewvc/incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/ContentEntity.java?rev=1441440&r1=1441439&r2=1441440&view=diff
==============================================================================
--- incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/ContentEntity.java
(original)
+++ incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/ContentEntity.java
Fri Feb  1 13:29:54 2013
@@ -32,16 +32,20 @@ import java.util.Set;
 public class ContentEntity {
     private Map<String, Object> data;
 
+    public final static String CHARSET = "charset";
     public final static String CONTENT = "content";
     public final static String CONTENT_TYPE = "content-type";
     public final static String CONTENT_LENGTH = "content-length";
     public final static String LINKS = "links";
 
+    public final static String DEFAULT_CHARSET = "UTF-8";
+
     /**
      * Constructor
      */
     public ContentEntity() {
         this.data = new HashMap<String, Object>();
+        setCharset(DEFAULT_CHARSET);
     }
 
     /**
@@ -144,6 +148,24 @@ public class ContentEntity {
     }
 
     /**
+     * Get the charset.
+     *
+     * @return the charset
+     */
+    public String getCharset() {
+        return this.getValue(CHARSET).toString();
+    }
+
+    /**
+     * Set the charset of the document.
+     *
+     * @param charset the charset
+     */
+    public void setCharset(String charset) {
+        this.put(CHARSET, charset);
+    }
+
+    /**
      * Get the content type.
      *
      * @return the content type
@@ -152,6 +174,7 @@ public class ContentEntity {
         return this.getValue(CONTENT_TYPE).toString();
     }
 
+
     /**
      * Set the content length
      *



Mime
View raw message