summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/common-http/src/main
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2010-04-27 21:42:48 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2010-04-27 21:42:48 +0000
commit7d4795637bf73d7e0ce27a086e46b7853f0068ec (patch)
tree2991613c193c990f3154f5c88eb18326c0ad908f /sca-java-2.x/trunk/modules/common-http/src/main
parent047ade832c6f41b92256a968bbb3bcabbaf8f5c0 (diff)
Making strings as constants...
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@938682 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/common-http/src/main')
-rw-r--r--sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/HTTPConstants.java6
-rw-r--r--sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/HTTPContentTypeMapper.java8
2 files changed, 9 insertions, 5 deletions
diff --git a/sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/HTTPConstants.java b/sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/HTTPConstants.java
index 34052bfea8..2b1469216e 100644
--- a/sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/HTTPConstants.java
+++ b/sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/HTTPConstants.java
@@ -19,9 +19,13 @@
package org.apache.tuscany.sca.common.http;
-public class HTTPConstants {
+public interface HTTPConstants {
public static final String CHARACTER_ENCODING_UTF8 = "UTF-8";
+ public static final String HTM = "htm";
+ public static final String HTML = "html";
+ public static final String JAVASCRIPT = "js";
+
public static final String HTML_CONTENT_TYPE = "text/html";
public static final String JAVASCRIPT_CONTENT_TYPE = "text/javascript";
}
diff --git a/sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/HTTPContentTypeMapper.java b/sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/HTTPContentTypeMapper.java
index 1ce8cd2fd1..d961b093fc 100644
--- a/sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/HTTPContentTypeMapper.java
+++ b/sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/HTTPContentTypeMapper.java
@@ -26,13 +26,13 @@ import java.util.Map;
* Utility class to provide default HTTP Content-Type header
* based on resource type
*/
-public class HTTPContentTypeMapper {
+public class HTTPContentTypeMapper implements HTTPConstants{
private static Map<String, String> contentTypeTable = new HashMap<String, String>();
static {
- contentTypeTable.put("htm", HTTPConstants.HTML_CONTENT_TYPE);
- contentTypeTable.put("html", HTTPConstants.HTML_CONTENT_TYPE);
- contentTypeTable.put("js", "text/javascript");
+ contentTypeTable.put(HTM, HTML_CONTENT_TYPE);
+ contentTypeTable.put(HTML, HTML_CONTENT_TYPE);
+ contentTypeTable.put(JAVASCRIPT, JAVASCRIPT_CONTENT_TYPE);
}
/**