unico       2004/07/06 13:09:51

  Modified:    webdavclient/ant/src/java/org/apache/webdav/ant/taskdefs
                        Move.java
               webdavclient/clientlib/src/java/org/apache/webdav/lib/methods
                        MoveMethod.java
               webdavclient/ant/src/java/org/apache/webdav/ant Utils.java
  Log:
  off course MOVE should not send Depth header :-/
  
  Revision  Changes    Path
  1.2       +3 -19     
jakarta-slide/webdavclient/ant/src/java/org/apache/webdav/ant/taskdefs/Move.java
  
  Index: Move.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/webdavclient/ant/src/java/org/apache/webdav/ant/taskdefs/Move.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Move.java 6 Jul 2004 19:04:09 -0000       1.1
  +++ Move.java 6 Jul 2004 20:09:51 -0000       1.2
  @@ -24,7 +24,6 @@
   
   import org.apache.tools.ant.BuildException;
   import org.apache.webdav.ant.Utils;
  -import org.apache.webdav.lib.methods.DepthSupport;
   
   /**
    * WebDAV task for moving resources and collections.
  @@ -35,7 +34,6 @@
   public class Move extends WebdavMatchingTask {
   
       private String destination;
  -    private int depth;
       private boolean overwrite;
   
       /* 
  @@ -49,7 +47,6 @@
                   getHttpClient(), 
                   getUrl(),
                   this.destination,
  -                this.depth,
                   this.overwrite
               );
           }
  @@ -60,19 +57,6 @@
   
       public void setDestination(String destination) {
           this.destination = destination;
  -    }
  -
  -    public void setDepth(String value) {
  -        if ("0".trim().equals(value)) {
  -           this.depth = DepthSupport.DEPTH_0;
  -        }
  -        else if ("infinity".trim().toLowerCase().equals(value)) {
  -           this.depth = DepthSupport.DEPTH_INFINITY;
  -        }
  -        else {
  -            throw new BuildException("Invalid value of depth attribute." 
  -                 + " (One of '0' or 'infinity' expected)");
  -        }
       }
   
       public void setOverwrite(boolean value) {
  
  
  
  1.4       +1 -45     
jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/methods/MoveMethod.java
  
  Index: MoveMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/methods/MoveMethod.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MoveMethod.java   6 Jul 2004 19:03:06 -0000       1.3
  +++ MoveMethod.java   6 Jul 2004 20:09:51 -0000       1.4
  @@ -73,13 +73,6 @@
           setOverwrite(overwrite);
       }
   
  -    /**
  -     * Method constructor.
  -     */
  -    public MoveMethod(String source, String destination, boolean overwrite, int 
depth) {
  -        this(source, destination, overwrite);
  -        setDepth(depth);
  -    }
   
       // ----------------------------------------------------- Instance Variables
   
  @@ -95,10 +88,6 @@
        */
       private boolean overwrite = true;
   
  -    /**
  -     * Depth.
  -     */
  -    private int depth = DepthSupport.DEPTH_INFINITY;
   
       // ------------------------------------------------------------- Properties
   
  @@ -119,14 +108,6 @@
           else if(headerName.equalsIgnoreCase("Destination")){
               setDestination(headerValue);
           }
  -        else if (headerName.equalsIgnoreCase("Depth")) {
  -            if (headerValue.equalsIgnoreCase("Infinity")) {
  -                setDepth(DepthSupport.DEPTH_INFINITY);
  -            }
  -            else if (headerValue.equalsIgnoreCase("0")) {
  -                setDepth(0);
  -            }
  -        }
           else{
               super.setRequestHeader(headerName, headerValue);
           }
  @@ -185,24 +166,6 @@
           return overwrite;
       }
   
  -    /**
  -     * Depth setter.
  -     * 
  -     * @param depth New depth value
  -     */
  -    public void setDepth(int depth) {
  -        checkNotUsed();
  -        this.depth = depth;
  -    }
  -
  -    /**
  -     * Depth getter.
  -     * 
  -     * @return Depth value
  -     */
  -    public int getDepth() {
  -        return this.depth;
  -    }
   
       // --------------------------------------------------- WebdavMethod Methods
   
  @@ -230,15 +193,8 @@
           if (!isOverwrite())
               super.setRequestHeader("Overwrite", "F");
   
  -        switch (depth) {
  -             case DepthSupport.DEPTH_0:
  -                 super.setRequestHeader("Depth", "0");
  -                 break;
  -             case DepthSupport.DEPTH_INFINITY:
  -                 super.setRequestHeader("Depth", "Infinity");
  -                 break;
  -        }
       }
  +
   
   }
   
  
  
  
  1.4       +5 -5      
jakarta-slide/webdavclient/ant/src/java/org/apache/webdav/ant/Utils.java
  
  Index: Utils.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/webdavclient/ant/src/java/org/apache/webdav/ant/Utils.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Utils.java        6 Jul 2004 19:04:09 -0000       1.3
  +++ Utils.java        6 Jul 2004 20:09:51 -0000       1.4
  @@ -366,10 +366,10 @@
      }
   
      public static void moveResource(HttpClient client, HttpURL url, 
  -                                   String destination, int depth, boolean overwrite)
  +                                   String destination, boolean overwrite)
         throws IOException, HttpException 
      {
  -      MoveMethod move = new MoveMethod(url.getURI(), destination, overwrite, depth);
  +      MoveMethod move = new MoveMethod(url.getURI(), destination, overwrite);
         int status = client.executeMethod(move);
         switch (status) {
            case WebdavStatus.SC_OK:
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to