summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-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);
}
/**