You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by ju...@apache.org on 2001/04/03 13:06:15 UTC

cvs commit: jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods CopyMethod.java LockMethod.java MoveMethod.java PropFindMethod.java UnlockMethod.java

juergen     01/04/03 04:06:15

  Modified:    src/webdav/client/src/org/apache/webdav/lib/methods
                        CopyMethod.java LockMethod.java MoveMethod.java
                        PropFindMethod.java UnlockMethod.java
  Log:
  the setHeader method will now call the specialised methods (e.g. setDepth, setOverwrite) in case of the headerName directs to these specialised methods.
  
  Revision  Changes    Path
  1.10      +26 -3     jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/CopyMethod.java
  
  Index: CopyMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/CopyMethod.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CopyMethod.java	2001/04/03 10:32:38	1.9
  +++ CopyMethod.java	2001/04/03 11:06:07	1.10
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/CopyMethod.java,v 1.9 2001/04/03 10:32:38 juergen Exp $
  - * $Revision: 1.9 $
  - * $Date: 2001/04/03 10:32:38 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/CopyMethod.java,v 1.10 2001/04/03 11:06:07 juergen Exp $
  + * $Revision: 1.10 $
  + * $Date: 2001/04/03 11:06:07 $
    *
    * ====================================================================
    *
  @@ -134,6 +134,28 @@
   
   
       /**
  +     * Set header. handle the special case of Overwrite and Destination
  +     *
  +     * @param headerName Header name
  +     * @param headerValue Header value
  +     */
  +    public void setHeader(String headerName, String headerValue) {
  +        if (headerName.equalsIgnoreCase("Overwrite")){
  +            setOverwrite(! (headerValue.equalsIgnoreCase("F") ||
  +                           headerValue.equalsIgnoreCase("False") ) );
  +        }
  +        else if(headerName.equalsIgnoreCase("Destination")){
  +            setDestination(headerValue);
  +        }
  +        else{
  +            super.setHeader(headerName, headerValue);
  +        }
  +    }
  +
  +
  +
  +
  +    /**
        * Destination setter.
        *
        * @param destination New destination value
  @@ -209,3 +231,4 @@
   
   
   }
  +
  
  
  
  1.16      +39 -7     jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/LockMethod.java
  
  Index: LockMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/LockMethod.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- LockMethod.java	2001/04/03 10:32:41	1.15
  +++ LockMethod.java	2001/04/03 11:06:09	1.16
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/LockMethod.java,v 1.15 2001/04/03 10:32:41 juergen Exp $
  - * $Revision: 1.15 $
  - * $Date: 2001/04/03 10:32:41 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/LockMethod.java,v 1.16 2001/04/03 11:06:09 juergen Exp $
  + * $Revision: 1.16 $
  + * $Date: 2001/04/03 11:06:09 $
    *
    * ====================================================================
    *
  @@ -247,7 +247,39 @@
   
       // ------------------------------------------------------------- Properties
   
  +        
  +        
  +        
  +    /**
  +     * Set header. handle the special case of Depth and Time
  +     *
  +     * @param headerName Header name
  +     * @param headerValue Header value
  +     */
  +    public void setHeader(String headerName, String headerValue) {
  +        if (headerName.equalsIgnoreCase("Depth")){
  +            int depth = -1;
  +            if (headerValue.equals("0")){
  +                depth = DEPTH_0;
  +            }
  +            if (headerValue.equals("1")){
  +                depth = DEPTH_1;
  +            }
  +            else if (headerValue.equalsIgnoreCase("infinity")){
  +                depth = DEPTH_INFINITY;
  +            }
  +            setDepth(depth);
  +        }
  +        else if(headerName.equalsIgnoreCase("Destination")){
  +            setTimeout(Long.parseLong(headerValue));
  +        }
  +        else{
  +            super.setHeader(headerName, headerValue);
  +        }
  +    }
   
  +
  +
       /**
        * Depth setter.
        *
  @@ -256,8 +288,7 @@
       public void setDepth(int depth) {
           checkNotUsed();
           if (depth != DEPTH_0 && depth != DEPTH_INFINITY) {
  -            throw new IllegalArgumentException(
  -                "invalid depth value for lock method");
  +            throw new IllegalArgumentException("invalid depth value for lock method " + depth);
           }
           this.depth = depth;
       }
  @@ -327,8 +358,8 @@
       public void setTimeout(long timeout) {
           checkNotUsed();
           if (timeout < 0) {
  -            throw new IllegalArgumentException
  -                ("invalid timeout value: " + timeout);
  +            throw new IllegalArgumentException("invalid timeout value: " +
  +                                                   timeout);
           }
           this.timeout = timeout;
       }
  @@ -483,3 +514,4 @@
           }
       }
   }
  +
  
  
  
  1.10      +26 -3     jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/MoveMethod.java
  
  Index: MoveMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/MoveMethod.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- MoveMethod.java	2001/04/03 10:32:43	1.9
  +++ MoveMethod.java	2001/04/03 11:06:09	1.10
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/MoveMethod.java,v 1.9 2001/04/03 10:32:43 juergen Exp $
  - * $Revision: 1.9 $
  - * $Date: 2001/04/03 10:32:43 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/MoveMethod.java,v 1.10 2001/04/03 11:06:09 juergen Exp $
  + * $Revision: 1.10 $
  + * $Date: 2001/04/03 11:06:09 $
    *
    * ====================================================================
    *
  @@ -130,6 +130,28 @@
   
   
       // ------------------------------------------------------------- Properties
  +        
  +        
  +        
  +    /**
  +     * Set header. handle the special case of Overwrite and Destination
  +     *
  +     * @param headerName Header name
  +     * @param headerValue Header value
  +     */
  +    public void setHeader(String headerName, String headerValue) {
  +        if (headerName.equalsIgnoreCase("Overwrite")){
  +            setOverwrite(! (headerValue.equalsIgnoreCase("F") ||
  +                           headerValue.equalsIgnoreCase("False") ) );
  +        }
  +        else if(headerName.equalsIgnoreCase("Destination")){
  +            setDestination(headerValue);
  +        }
  +        else{
  +            super.setHeader(headerName, headerValue);
  +        }
  +    }
  +
   
   
       /**
  @@ -208,3 +230,4 @@
   
   
   }
  +
  
  
  
  1.21      +32 -3     jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/PropFindMethod.java
  
  Index: PropFindMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/PropFindMethod.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- PropFindMethod.java	2001/04/03 10:32:45	1.20
  +++ PropFindMethod.java	2001/04/03 11:06:10	1.21
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/PropFindMethod.java,v 1.20 2001/04/03 10:32:45 juergen Exp $
  - * $Revision: 1.20 $
  - * $Date: 2001/04/03 10:32:45 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/PropFindMethod.java,v 1.21 2001/04/03 11:06:10 juergen Exp $
  + * $Revision: 1.21 $
  + * $Date: 2001/04/03 11:06:10 $
    *
    * ====================================================================
    *
  @@ -217,7 +217,35 @@
   
       // ------------------------------------------------------------- Properties
   
  +        
  +        
  +        
  +    /**
  +     * Set header. handle the special case of Depth.
  +     *
  +     * @param headerName Header name
  +     * @param headerValue Header value
  +     */
  +    public void setHeader(String headerName, String headerValue) {
  +        if (headerName.equalsIgnoreCase("Depth")){
  +            int depth = -1;
  +            if (headerValue.equals("0")){
  +                depth = DEPTH_0;
  +            }
  +            if (headerValue.equals("1")){
  +                depth = DEPTH_1;
  +            }
  +            else if (headerValue.equalsIgnoreCase("infinity")){
  +                depth = DEPTH_INFINITY;
  +            }
  +            setDepth(depth);
  +        }
  +        else{
  +            super.setHeader(headerName, headerValue);
  +        }
  +    }
   
  +
       /**
        * Type setter.
        *
  @@ -379,3 +407,4 @@
   
       }
   }
  +
  
  
  
  1.8       +23 -3     jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/UnlockMethod.java
  
  Index: UnlockMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/UnlockMethod.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- UnlockMethod.java	2001/04/03 10:32:47	1.7
  +++ UnlockMethod.java	2001/04/03 11:06:11	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/UnlockMethod.java,v 1.7 2001/04/03 10:32:47 juergen Exp $
  - * $Revision: 1.7 $
  - * $Date: 2001/04/03 10:32:47 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/UnlockMethod.java,v 1.8 2001/04/03 11:06:11 juergen Exp $
  + * $Revision: 1.8 $
  + * $Date: 2001/04/03 11:06:11 $
    *
    * ====================================================================
    *
  @@ -128,7 +128,26 @@
       
       
       // --------------------------------------------------- WebdavMethod Methods
  +        
  +        
  +        
  +    /**
  +     * Set header. handle the special case of lock-token.
  +     *
  +     * @param headerName Header name
  +     * @param headerValue Header value
  +     */
  +    public void setHeader(String headerName, String headerValue) {
  +        if (headerName.equalsIgnoreCase("Lock-Token")){
  +            setLockToken(headerValue);
  +        }
  +        else{
  +            super.setHeader(headerName, headerValue);
  +        }
  +    }
   
  +
  +
       
       /**
        * Generate additional headers needed by the request.
  @@ -160,3 +179,4 @@
       
       
   }
  +