msmith      01/10/16 16:44:45

  Modified:    src/contrib/webdavgui/src/java/org/apache/webdav/ui/util
                        SPUtils.java
               src/contrib/webdavgui/src/java/org/apache/webdav/ui/filechooser/dir
                        SPWebFolder.java
  Log:
  Fix for problem that caused stray 40x errors at times.
  
  Revision  Changes    Path
  1.8       +15 -9     
jakarta-slide/src/contrib/webdavgui/src/java/org/apache/webdav/ui/util/SPUtils.java
  
  Index: SPUtils.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/contrib/webdavgui/src/java/org/apache/webdav/ui/util/SPUtils.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SPUtils.java      2001/10/10 04:42:45     1.7
  +++ SPUtils.java      2001/10/16 23:44:45     1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/contrib/webdavgui/src/java/org/apache/webdav/ui/util/SPUtils.java,v
 1.7 2001/10/10 04:42:45 msmith Exp $
  - * $Revision: 1.7 $
  - * $Date: 2001/10/10 04:42:45 $
  + * $Header: 
/home/cvs/jakarta-slide/src/contrib/webdavgui/src/java/org/apache/webdav/ui/util/SPUtils.java,v
 1.8 2001/10/16 23:44:45 msmith Exp $
  + * $Revision: 1.8 $
  + * $Date: 2001/10/16 23:44:45 $
    *
    * ====================================================================
    *
  @@ -338,16 +338,22 @@
   
           propFindMethod = new SPPropFindMethod(client);
           propFindMethod.setPath(checkedPath);
  -     propFindMethod.setDepth(DepthSupport.DEPTH_0);
  +         propFindMethod.setDepth(DepthSupport.DEPTH_0);
   
           try {
             propFindMethod.executeByName(propList.elements());
             int statusCode = propFindMethod.getStatusCode();
  -          
  -          if ( (statusCode == HttpStatus.SC_NOT_FOUND) &&
  -                (propertyName.equals("current-user-privilege-set")) )  {
  -            checkParent = (! checkParent) ? true: false; //a toggle
  -            checkedPath = getParentUrl(checkedPath);
  +         
  +          // Handle case of a non-existent file
  +          // Check permissions on parent
  +          // Return null for lock property 
  +          if (statusCode == HttpStatus.SC_NOT_FOUND
  +              || statusCode == HttpStatus.SC_BAD_REQUEST) {
  +              if (propertyName.equals("current-user-privilege-set")) { 
  +                checkParent = (! checkParent) ? true: false; //a toggle
  +                checkedPath = getParentUrl(checkedPath);
  +              } else if (propertyName.equals("lockdiscovery"))
  +                  return null;
             }
             else if ( (statusCode >=200 && statusCode<300) )  {
               checkParent = false;
  
  
  
  1.4       +4 -4      
jakarta-slide/src/contrib/webdavgui/src/java/org/apache/webdav/ui/filechooser/dir/SPWebFolder.java
  
  Index: SPWebFolder.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/contrib/webdavgui/src/java/org/apache/webdav/ui/filechooser/dir/SPWebFolder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SPWebFolder.java  2001/10/10 04:42:45     1.3
  +++ SPWebFolder.java  2001/10/16 23:44:45     1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/contrib/webdavgui/src/java/org/apache/webdav/ui/filechooser/dir/SPWebFolder.java,v
 1.3 2001/10/10 04:42:45 msmith Exp $
  - * $Revision: 1.3 $
  - * $Date: 2001/10/10 04:42:45 $
  + * $Header: 
/home/cvs/jakarta-slide/src/contrib/webdavgui/src/java/org/apache/webdav/ui/filechooser/dir/SPWebFolder.java,v
 1.4 2001/10/16 23:44:45 msmith Exp $
  + * $Revision: 1.4 $
  + * $Date: 2001/10/16 23:44:45 $
    *
    * ====================================================================
    *
  @@ -145,7 +145,7 @@
   
       int statusCode = propFindMethod.getStatusCode();
   
  -    if (statusCode != HttpStatus.SC_MULTI_STATUS) {
  +    if (statusCode<200 || statusCode >299)  {
         final String title = "Remote Failure";
         final String msg = "Unable to access a remote directory ("+statusCode+")";
         SPUtils.showMessageDialog(title, msg);
  
  
  


Reply via email to