abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eli...@apache.org
Subject svn commit: r422141 - in /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server: RequestContext.java exceptions/MethodNotAllowedException.java servlet/ServletRequestContext.java
Date Sat, 15 Jul 2006 03:33:55 GMT
Author: eliast
Date: Fri Jul 14 20:33:54 2006
New Revision: 422141

URL: http://svn.apache.org/viewvc?rev=422141&view=rev
Log:
- Removed enum that constrained us to use only HTTP 1.1 method names.

Modified:
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/RequestContext.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/exceptions/MethodNotAllowedException.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/ServletRequestContext.java

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/RequestContext.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/RequestContext.java?rev=422141&r1=422140&r2=422141&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/RequestContext.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/RequestContext.java
Fri Jul 14 20:33:54 2006
@@ -23,12 +23,8 @@
 import java.util.List;
 
 public interface RequestContext {
-
-  public static enum Method {
-    GET, POST, PUT, DELETE, OPTIONS, HEAD
-  }
   
-  public Method getMethod();
+  public String getMethod();
   
   public URI getRequestUri();
   

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/exceptions/MethodNotAllowedException.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/exceptions/MethodNotAllowedException.java?rev=422141&r1=422140&r2=422141&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/exceptions/MethodNotAllowedException.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/exceptions/MethodNotAllowedException.java
Fri Jul 14 20:33:54 2006
@@ -17,9 +17,6 @@
 */
 package org.apache.abdera.server.exceptions;
 
-import org.apache.abdera.server.RequestContext;
-
-
 public class MethodNotAllowedException 
   extends AbderaServerException {
 
@@ -33,15 +30,15 @@
     super(405, text);
   }
   
-  public void setAllow(RequestContext.Method[] methods) {
+  public void setAllow(String[] methods) {
     if(methods == null || methods.length == 0) {
       throw new IllegalArgumentException("Methods argument must not be empty or null.");
     }
     boolean first = true;
     StringBuffer value = new StringBuffer();
-    for(RequestContext.Method method : methods) {
+    for(String method : methods) {
       if(first) {
-        value.append(method.toString());
+        value.append(method.toString().toUpperCase());
         first = false;
         continue;
       }

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/ServletRequestContext.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/ServletRequestContext.java?rev=422141&r1=422140&r2=422141&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/ServletRequestContext.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/ServletRequestContext.java
Fri Jul 14 20:33:54 2006
@@ -39,8 +39,8 @@
     this.servletRequest = request;
   }
   
-  public Method getMethod() {
-    return Method.valueOf(servletRequest.getMethod());
+  public String getMethod() {
+    return servletRequest.getMethod();
   }
   
   public URI getRequestUri() {



Mime
View raw message