remm        01/07/09 11:19:22

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        PropFindMethod.java
  Log:
  - Don't retrieve the child objects unless it's necessary. That should make a
    PROPFIND with a depth 1 (the most commen PROPFIND type) a lot more
    efficient.
    Many thanks to Nelis Bijl <Nelis.Bijl at redwood.nl> for the patch.
  
  Revision  Changes    Path
  1.24      +26 -20    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java
  
  Index: PropFindMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- PropFindMethod.java       2001/05/29 02:34:57     1.23
  +++ PropFindMethod.java       2001/07/09 18:19:17     1.24
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java,v
 1.23 2001/05/29 02:34:57 remm Exp $
  - * $Revision: 1.23 $
  - * $Date: 2001/05/29 02:34:57 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java,v
 1.24 2001/07/09 18:19:17 remm Exp $
  + * $Revision: 1.24 $
  + * $Date: 2001/07/09 18:19:17 $
    *
    * ====================================================================
    *
  @@ -478,24 +478,30 @@
                       ObjectNode cur = (ObjectNode) stack.pop();
                       parsePropertiesOfObject(cur, generatedXML);
                       
  -                    Enumeration enum = null;
  -                    
  -                    try {
  -                        enum = structure.getChildren(slideToken, cur);
  -                    } catch (StructureException e) {
  -                        e.printStackTrace();
  -                        resp.setStatus(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  -                        throw new WebdavException
  -                            (WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  -                    } catch (ServiceAccessException e) {
  -                        e.printStackTrace();
  -                        resp.setStatus(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  -                        throw new WebdavException
  -                            (WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  -                    }
  +                    if (depth > 0) {
  +                        
  +                        Enumeration enum = null;
  +                        
  +                        try {
  +                            enum = structure.getChildren(slideToken, cur);
  +                        } catch (StructureException e) {
  +                            e.printStackTrace();
  +                            resp.setStatus
  +                                (WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  +                            throw new WebdavException
  +                                (WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  +                        } catch (ServiceAccessException e) {
  +                            e.printStackTrace();
  +                            resp.setStatus
  +                                (WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  +                            throw new WebdavException
  +                                (WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  +                        }
  +                        
  +                        while (enum.hasMoreElements()) {
  +                            stackBelow.push(enum.nextElement());
  +                        }
                       
  -                    while (enum.hasMoreElements()) {
  -                        stackBelow.push(enum.nextElement());
                       }
                       
                       if (stack.isEmpty()) {
  
  
  

Reply via email to