morgand     01/08/21 09:28:46

  Modified:    latka/conf suite.dtd
               latka/src/java/org/apache/commons/latka/http Request.java
                        RequestImpl.java
               latka/src/java/org/apache/commons/latka/xml
                        RequestHandler.java
  Log:
  added head method, may need more work on the validation side
  
  Revision  Changes    Path
  1.8       +1 -1      jakarta-commons/latka/conf/Attic/suite.dtd
  
  Index: suite.dtd
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/conf/Attic/suite.dtd,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- suite.dtd 2001/08/20 20:26:51     1.7
  +++ suite.dtd 2001/08/21 16:28:45     1.8
  @@ -21,7 +21,7 @@
   
   <!ELEMENT request (credentials?, requestHeader*, param*, validate?)>
   <!ATTLIST request path   CDATA           #REQUIRED
  -                  method (post | get)   "get"
  +                  method (post | get | head)   "get"
                     secure (true | false) "false"
                     host   CDATA           #IMPLIED
                     port   CDATA           #IMPLIED
  
  
  
  1.5       +3 -1      
jakarta-commons/latka/src/java/org/apache/commons/latka/http/Request.java
  
  Index: Request.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/http/Request.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Request.java      2001/08/20 20:26:51     1.4
  +++ Request.java      2001/08/21 16:28:45     1.5
  @@ -20,7 +20,9 @@
     public static final int HTTP_METHOD_GET = 0;
     /** An integer representing the HTTP POST method */
     public static final int HTTP_METHOD_POST = 1;
  -
  +  /** An integer representing the HTTP POST method */
  +  public static final int HTTP_METHOD_HEAD = 2;
  +  
     /**
      * Execute this HTTP request.
      *
  
  
  
  1.7       +3 -0      
jakarta-commons/latka/src/java/org/apache/commons/latka/http/RequestImpl.java
  
  Index: RequestImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/http/RequestImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RequestImpl.java  2001/08/20 21:45:03     1.6
  +++ RequestImpl.java  2001/08/21 16:28:46     1.7
  @@ -10,6 +10,7 @@
   import org.apache.commons.httpclient.State;
   import org.apache.commons.httpclient.HttpMethod;
   import org.apache.commons.httpclient.methods.GetMethod;
  +import org.apache.commons.httpclient.methods.HeadMethod;
   import org.apache.commons.httpclient.methods.PostMethod;
   
   import org.apache.log4j.Category;
  @@ -58,6 +59,8 @@
           _httpMethod = new PostMethod(url.getPath());
           ((PostMethod) _httpMethod).setUseDisk(false);
           break;
  +      case HTTP_METHOD_HEAD:
  +        _httpMethod = new HeadMethod(url.getPath());
         default:
           throw new IllegalArgumentException("Unsupported HTTP Method");
       }
  
  
  
  1.7       +2 -0      
jakarta-commons/latka/src/java/org/apache/commons/latka/xml/RequestHandler.java
  
  Index: RequestHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/xml/RequestHandler.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RequestHandler.java       2001/08/20 21:45:03     1.6
  +++ RequestHandler.java       2001/08/21 16:28:46     1.7
  @@ -175,6 +175,8 @@
         method = Request.HTTP_METHOD_GET;
       } else if (methodString.equalsIgnoreCase("post")) {
         method = Request.HTTP_METHOD_POST;
  +    } else if (methodString.equalsIgnoreCase("head")) {
  +      method = Request.HTTP_METHOD_HEAD;
       } else {
         method = Request.HTTP_METHOD_GET;
       }
  
  
  

Reply via email to