juergen     02/02/04 03:46:31

  Modified:    src/webdav/client/src/org/apache/webdav/lib/methods
                        AclMethod.java
  Log:
  The ACL method may return an XML body as response.
  
  Revision  Changes    Path
  1.4       +28 -28    
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/AclMethod.java
  
  Index: AclMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/AclMethod.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AclMethod.java    21 Jul 2001 14:06:06 -0000      1.3
  +++ AclMethod.java    4 Feb 2002 11:46:31 -0000       1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/AclMethod.java,v
 1.3 2001/07/21 14:06:06 dirkv Exp $
  - * $Revision: 1.3 $
  - * $Date: 2001/07/21 14:06:06 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/AclMethod.java,v
 1.4 2002/02/04 11:46:31 juergen Exp $
  + * $Revision: 1.4 $
  + * $Date: 2002/02/04 11:46:31 $
    *
    * ====================================================================
    *
  @@ -88,7 +88,7 @@
    * @author Dirk Verbeeck
    */
   public class AclMethod
  -    extends HttpMethodBase {
  +    extends XMLResponseMethodBase {
       
       
       // -------------------------------------------------------------- Constants
  @@ -125,7 +125,7 @@
       
       /**
        * Add an ace to the ace list which will be set by the method.
  -     * 
  +     *
        * @param ace Access control entry
        */
       public void addAce(Ace ace) {
  @@ -178,36 +178,36 @@
           while (aceList.hasMoreElements()) {
               Ace ace = (Ace) aceList.nextElement();
               
  -                     if (ace.isInherited() || ace.isProtected()) {
  -                             // draft-ietf-webdav-acl-06
  -                             // do not submit inherited and protected aces
  -                             // continue with next ace
  -                             continue;
  -                     }
  -                     
  +            if (ace.isInherited() || ace.isProtected()) {
  +                // draft-ietf-webdav-acl-06
  +                // do not submit inherited and protected aces
  +                // continue with next ace
  +                continue;
  +            }
  +            
               printer.writeElement("D", null, "ace",
                                    XMLPrinter.OPENING);
               
               printer.writeElement("D", null, "principal",
                                    XMLPrinter.OPENING);
  -                     
  -                     boolean found=false;
  +            
  +            boolean found=false;
               String principal=ace.getPrincipal();
               String[] 
types={"all","authenticated","unauthenticated","property","self"};
  -                     for (int i=0; i<types.length && found==false; i++)
  -                     {
  -                             if (types[i].equals(principal)) {
  -                                     found=true;
  -                                     printer.writeElement("D",null,principal, 
XMLPrinter.NO_CONTENT);
  -                             }
  -                     }
  -                     if (!found)
  -                     {
  -                             printer.writeElement("D", null, "href", 
XMLPrinter.OPENING);
  -                 printer.writeText(ace.getPrincipal());
  -                             printer.writeElement("D", null, "href", 
XMLPrinter.CLOSING);
  -                     }
  -                     
  +            for (int i=0; i<types.length && found==false; i++)
  +            {
  +                if (types[i].equals(principal)) {
  +                    found=true;
  +                    printer.writeElement("D",null,principal, XMLPrinter.NO_CONTENT);
  +                }
  +            }
  +            if (!found)
  +            {
  +                printer.writeElement("D", null, "href", XMLPrinter.OPENING);
  +                printer.writeText(ace.getPrincipal());
  +                printer.writeElement("D", null, "href", XMLPrinter.CLOSING);
  +            }
  +            
               printer.writeElement("D", null, "principal",
                                    XMLPrinter.CLOSING);
               
  
  
  

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

Reply via email to