[prev in list] [next in list] [prev in thread] [next in thread] 

List:       slide-dev
Subject:    cvs commit: jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd Slide.java
From:       dirkv () apache ! org
Date:       2001-10-21 17:31:31
[Download RAW message or body]

dirkv       01/10/21 10:31:31

  Modified:    src/webdav/client/src/org/apache/webdav/cmd Slide.java
  Log:
  Fix NullPointerExceptions when a property has no content.
  Patch by Anthony Nguyen and myself
  
  Revision  Changes    Path
  1.43      +29 -7     \
jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Slide.java  
  Index: Slide.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Slide.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- Slide.java	2001/10/07 20:47:48	1.42
  +++ Slide.java	2001/10/21 17:31:31	1.43
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Slide.java,v \
                1.42 2001/10/07 20:47:48 dirkv Exp $
  - * $Revision: 1.42 $
  - * $Date: 2001/10/07 20:47:48 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Slide.java,v \
1.43 2001/10/21 17:31:31 dirkv Exp $  + * $Revision: 1.43 $
  + * $Date: 2001/10/21 17:31:31 $
    *
    * ====================================================================
    *
  @@ -1025,9 +1025,12 @@
                           System.out.println("Error: PropFind didn't return an \
PrincipalCollectionSetProperty!");  continue;
                       }
  +                    String[] hrefs=set.getHrefs();
  +                    if (hrefs==null) {
  +                        System.out.println("No PrincipalCollectionSet for " + \
path);  +                    }
                       System.out.println();
                       System.out.println("PrincipalCollectionSet for " + path + \
                ":");
  -                    String[] hrefs=set.getHrefs();
                       for (int i=0 ; i<hrefs.length ; i++)
                           System.out.println("   " + hrefs[i]);
                       System.out.println();    
  @@ -1469,7 +1472,7 @@
           //        to really search for the principal
           if (!principal.startsWith("/") && !principal.startsWith("http")) {
               PrincipalCollectionSetProperty set = \
                webdavResource.principalCollectionSetFindMethod(path);
  -            if ((set!=null) && (set.getHrefs().length==1))
  +            if ((set!=null) && (set.getHrefs()!=null) && \
(set.getHrefs().length==1))  principal = set.getHrefs()[0] + "/" + principal;
           }
           return normalize(principal);
  @@ -1763,6 +1766,9 @@
               return false;
           }
           Ace[] aces=acl.getAces();
  +        
  +        if (aces==null)
  +            aces=new Ace[0];
                   
           if (debugLevel>5) {
               System.out.println();
  @@ -1830,6 +1836,12 @@
           }
           Ace[] aces=acl.getAces();
   
  +        if (aces==null) 
  +        {
  +            System.out.println("Privilege not found");
  +            return false;
  +        }
  +
           if (debugLevel>5) {
               System.out.println();
               System.out.println("ACL from server");
  @@ -1875,8 +1887,8 @@
               else 
               {    
                   aces=acl.getAces();
  -                  System.out.println();
  -                  System.out.println("ACL from server after update");
  +                System.out.println();
  +                System.out.println("ACL from server after update");
                   showAces(path, aces);
               }
           }
  @@ -1886,6 +1898,11 @@
       
       private void showAces(String path, Ace[] aces)
       {
  +        if ((aces==null) || (aces.length==0)) {
  +            System.out.println("ACL for " + path + " is empty.");
  +            return;
  +        }
  +        
           System.out.println("ACL for " + path + ":");
           System.out.println("------------------------------------------------------------");
  for (int i=0; i<aces.length ; i++) 
  @@ -1908,6 +1925,11 @@
       
       private void showLocks(String path, Lock[] locks)
       {
  +        if ((locks==null) || (locks.length==0)) {
  +            System.out.println("No locks on " + path);
  +            return;
  +        }
  +        
           System.out.println("Locks for " + path + ":");
           System.out.println("------------------------------------------------------------");
  for (int i=0; i<locks.length ; i++)
  
  
  


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic