jericho     01/04/12 10:39:23

  Modified:    src/webdav/client/src/org/apache/webdav/util
                        WebdavSession.java WebdavResource.java
  Log:
  - Add the debug function
  
  Revision  Changes    Path
  1.3       +16 -5     
jakarta-slide/src/webdav/client/src/org/apache/webdav/util/WebdavSession.java
  
  Index: WebdavSession.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/util/WebdavSession.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WebdavSession.java        2001/04/11 16:03:55     1.2
  +++ WebdavSession.java        2001/04/12 17:39:15     1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/util/WebdavSession.java,v
 1.2 2001/04/11 16:03:55 jericho Exp $
  - * $Revision: 1.2 $
  - * $Date: 2001/04/11 16:03:55 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/util/WebdavSession.java,v
 1.3 2001/04/12 17:39:15 jericho Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/04/12 17:39:15 $
    *
    * ====================================================================
    *
  @@ -99,9 +99,20 @@
   
   
       /**
  -     * To debug.
  +     * Debug level.
        */
  -    private int debug = 0;
  +    protected int debug = 0;
  +
  +
  +    // ------------------------------------------------------------- Properties
  +
  +
  +    /**
  +     * Set debug level.
  +     */
  +    public void setDebug(int debug) {
  +        this.debug = debug;
  +    }
   
   
       // ------------------------------------------------------  Public methods
  
  
  
  1.36      +35 -4     
jakarta-slide/src/webdav/client/src/org/apache/webdav/util/WebdavResource.java
  
  Index: WebdavResource.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/util/WebdavResource.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- WebdavResource.java       2001/04/11 16:03:56     1.35
  +++ WebdavResource.java       2001/04/12 17:39:18     1.36
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/util/WebdavResource.java,v
 1.35 2001/04/11 16:03:56 jericho Exp $
  - * $Revision: 1.35 $
  - * $Date: 2001/04/11 16:03:56 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/util/WebdavResource.java,v
 1.36 2001/04/12 17:39:18 jericho Exp $
  + * $Revision: 1.36 $
  + * $Date: 2001/04/12 17:39:18 $
    *
    * ====================================================================
    *
  @@ -1274,6 +1274,8 @@
   
           // use disk to save by default
           GetMethod method = new GetMethod(httpURL.getPath(), tempDir);
  +        client.setDebug(debug);
  +        method.setDebug(debug);
           client.executeMethod(method);
   
           InputStream is = method.getData();
  @@ -1316,6 +1318,8 @@
               // use disk to save by default
               String source = httpURL.getPath();
               method = new GetMethod(source, tempDir, tempFile);
  +            client.setDebug(debug);
  +            method.setDebug(debug);
               client.executeMethod(method);
   
               is = method.getData();
  @@ -1384,6 +1388,8 @@
   
           // use disk to save by default
           GetMethod method = new GetMethod(HttpURL.getAbsPathQuery(path), file);
  +        client.setDebug(debug);
  +        method.setDebug(debug);
           client.executeMethod(method);
   
           int statusCode = method.getStatusCode();
  @@ -1427,6 +1433,8 @@
   
           PutMethod method = new PutMethod(HttpURL.getPath(path));
           method.sendData(data);
  +        client.setDebug(debug);
  +        method.setDebug(debug);
           client.executeMethod(method);
   
           int statusCode = method.getStatusCode();
  @@ -1470,6 +1478,8 @@
   
           PutMethod method = new PutMethod(HttpURL.getPath(path));
           method.sendData(file);
  +        client.setDebug(debug);
  +        method.setDebug(debug);
           client.executeMethod(method);
   
           int statusCode = method.getStatusCode();
  @@ -1512,6 +1522,8 @@
               method = new OptionsMethod("*");
           else
               method = new OptionsMethod(HttpURL.getPath(path));
  +        client.setDebug(debug);
  +        method.setDebug(debug);
           client.executeMethod(method);
   
           int statusCode = method.getStatusCode();
  @@ -1637,6 +1649,8 @@
           path = HttpURL.getPath(path);
           // Change the depth for allprop
           PropFindMethod method = new PropFindMethod(path, depth);
  +        client.setDebug(debug);
  +        method.setDebug(debug);
           // Default depth=infinity, type=allprop
           client.executeMethod(method);
   
  @@ -1723,6 +1737,8 @@
           // Default depth=1, type=by_name
           PropFindMethod method =
               new PropFindMethod(path, properties.elements());
  +        client.setDebug(debug);
  +        method.setDebug(debug);
           client.executeMethod(method);
   
           // Actually, the multi-status status code has the first priority.
  @@ -1856,6 +1872,8 @@
           }
   
           if (hasSomething) {
  +            client.setDebug(debug);
  +            method.setDebug(debug);
               client.executeMethod(method);
   
               // Possbile Status Codes => SC_OK
  @@ -1900,6 +1918,8 @@
           WebdavClient client = getSessionInstance(httpURL);
   
           HeadMethod method = new HeadMethod(HttpURL.getPath(path));
  +        client.setDebug(debug);
  +        method.setDebug(debug);
           client.executeMethod(method);
   
           int statusCode = method.getStatusCode();
  @@ -1940,6 +1960,8 @@
           WebdavClient client = getSessionInstance(httpURL);
   
           DeleteMethod method = new DeleteMethod(HttpURL.getPath(path));
  +        client.setDebug(debug);
  +        method.setDebug(debug);
           client.executeMethod(method);
   
           int statusCode = method.getStatusCode();
  @@ -1983,6 +2005,8 @@
           WebdavClient client = getSessionInstance(httpURL);
   
           MoveMethod method = new MoveMethod(source, destination);
  +        client.setDebug(debug);
  +        method.setDebug(debug);
           client.executeMethod(method);
   
           // Possbile MOVE Status Codes => SC_CREATED, SC_NO_CONTENT
  @@ -2029,6 +2053,8 @@
           WebdavClient client = getSessionInstance(httpURL);
   
           CopyMethod method = new CopyMethod(source, destination);
  +        client.setDebug(debug);
  +        method.setDebug(debug);
           client.executeMethod(method);
   
           // Possbile COPY Status Codes => SC_CREATED, SC_NO_CONTENT
  @@ -2072,6 +2098,8 @@
           WebdavClient client = getSessionInstance(httpURL);
   
           MkcolMethod method = new MkcolMethod(HttpURL.getPath(path));
  +        client.setDebug(debug);
  +        method.setDebug(debug);
           client.executeMethod(method);
   
           // Possbile MKCOL Status Codes => SC_CREATED
  @@ -2170,6 +2198,8 @@
           short lockType = LockMethod.SCOPE_EXCLUSIVE;
           LockMethod method =
               new LockMethod(HttpURL.getPath(path), owner, lockType, timeout);
  +        client.setDebug(debug);
  +        method.setDebug(debug);
           client.executeMethod(method);
           String lock = method.getLockToken();
           State state = client.getState();
  @@ -2237,6 +2267,8 @@
           // unlock for the given path.
           UnlockMethod method = new UnlockMethod(path);
           method.setLockToken(lock);
  +        client.setDebug(debug);
  +        method.setDebug(debug);
           client.executeMethod(method);
   
           int statusCode = method.getStatusCode();
  @@ -2338,4 +2370,3 @@
           return httpURL.toString();
       }
   }
  -
  
  
  

Reply via email to