dirkv       01/09/23 06:14:10

  Modified:    src/webdav/client/src/org/apache/webdav/lib Ace.java
                        Lock.java
  Log:
  toString methods for use with getPropertyAsString
  
  Revision  Changes    Path
  1.3       +12 -4     
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/Ace.java
  
  Index: Ace.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/Ace.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Ace.java  2001/05/17 18:30:32     1.2
  +++ Ace.java  2001/09/23 13:14:10     1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/Ace.java,v 1.2 
2001/05/17 18:30:32 remm Exp $
  - * $Revision: 1.2 $
  - * $Date: 2001/05/17 18:30:32 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/Ace.java,v 1.3 
2001/09/23 13:14:10 dirkv Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/09/23 13:14:10 $
    *
    * ====================================================================
    *
  @@ -70,7 +70,8 @@
    * This interface models a DAV Access control entry.
    *
    * @author Remy Maucherat
  - * @version $Revision: 1.2 $
  + * @author Dirk Verbeeck
  + * @version $Revision: 1.3 $
    */
   public class Ace {
   
  @@ -246,5 +247,12 @@
           privileges.clear();
       }
   
  +
  +     public String toString() {
  +             return ((!isNegative()?"granted":"denied") +
  +             " to " + getPrincipal() +
  +             " (" + (isProtected()?"protected":"not protected") + ")" +
  +             " (" + (isInherited()? ("inherited from '" + getInheritedFrom() + 
"'"): "not inherited") +")");
  +     }
   
   }
  
  
  
  1.3       +42 -4     
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/Lock.java
  
  Index: Lock.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/Lock.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Lock.java 2001/05/18 06:44:42     1.2
  +++ Lock.java 2001/09/23 13:14:10     1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/Lock.java,v 1.2 
2001/05/18 06:44:42 jericho Exp $
  - * $Revision: 1.2 $
  - * $Date: 2001/05/18 06:44:42 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/Lock.java,v 1.3 
2001/09/23 13:14:10 dirkv Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/09/23 13:14:10 $
    *
    * ====================================================================
    *
  @@ -63,12 +63,15 @@
   
   package org.apache.webdav.lib;
   
  +import org.apache.webdav.lib.methods.DepthSupport;
  +
   /**
    * This class represents a lock on a resource.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Park, Sung-Gu</a>
    * @author Remy Maucherat
  - * @version $Revision: 1.2 $
  + * @author Dirk Verbeeck
  + * @version $Revision: 1.3 $
    */
   public class Lock {
   
  @@ -209,5 +212,40 @@
           return lockToken;
       }
   
  +     public String toString() {
  +             StringBuffer tmp=new StringBuffer();
  +             
  +             if (lockScope==Lock.SCOPE_EXCLUSIVE) {
  +                     tmp.append("Exclusive");
  +             } 
  +             else if (lockScope==Lock.SCOPE_SHARED) {
  +                     tmp.append("Shared");
  +             }
  +             
  +             if (lockType==Lock.TYPE_WRITE) {
  +                     tmp.append(" write lock");
  +             }
  +             
  +             if (depth==DepthSupport.DEPTH_INFINITY) {
  +                     tmp.append(" depth:infinity");
  +             }
  +             else if (depth==-1) {
  +                     // unknown
  +             }
  +             else {
  +                     tmp.append(" depth:" + depth);
  +             }                       
  +
  +             if (owner!=null) 
  +                     tmp.append(" owner:" + owner);
  +                     
  +             if (timeout!=-1)
  +                     tmp.append(" timeout:" + timeout);
  +             
  +             if (lockToken!=null) 
  +                     tmp.append(" token:" + lockToken);
  +             
  +             return tmp.toString();  
  +     }
   
   }
  
  
  

Reply via email to