remm 02/04/01 10:12:39 Modified: catalina/src/share/org/apache/catalina/servlets WebdavServlet.java Log: - Avoid doing unecessary lists operations. - Patch submitted by Ewout Prangsma <e.prangsma at daisysoftware.com>. Revision Changes Path 1.28 +25 -24 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java Index: WebdavServlet.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- WebdavServlet.java 9 Mar 2002 23:22:38 -0000 1.27 +++ WebdavServlet.java 1 Apr 2002 18:12:38 -0000 1.28 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java,v 1.27 2002/03/09 23:22:38 remm Exp $ - * $Revision: 1.27 $ - * $Date: 2002/03/09 23:22:38 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java,v 1.28 2002/04/01 18:12:38 remm Exp $ + * $Revision: 1.28 $ + * $Date: 2002/04/01 18:12:38 $ * * ==================================================================== * @@ -126,7 +126,7 @@ * are handled by the DefaultServlet. * * @author Remy Maucherat - * @version $Revision: 1.27 $ $Date: 2002/03/09 23:22:38 $ + * @version $Revision: 1.28 $ $Date: 2002/04/01 18:12:38 $ */ public class WebdavServlet @@ -591,7 +591,9 @@ } catch (NamingException e) { continue; } - if (object instanceof DirContext) { + + if ((object instanceof DirContext) && (depth > 0)) { + try { NamingEnumeration enum = resources.list(currentPath); while (enum.hasMoreElements()) { @@ -610,27 +612,26 @@ return; } - if (depth > 0) { - // Displaying the lock-null resources present in that - // collection - String lockPath = currentPath; - if (lockPath.endsWith("/")) - lockPath = - lockPath.substring(0, lockPath.length() - 1); - Vector currentLockNullResources = - (Vector) lockNullResources.get(lockPath); - if (currentLockNullResources != null) { - Enumeration lockNullResourcesList = - currentLockNullResources.elements(); - while (lockNullResourcesList.hasMoreElements()) { - String lockNullPath = (String) - lockNullResourcesList.nextElement(); - parseLockNullProperties - (req, generatedXML, lockNullPath, type, - properties); - } + // Displaying the lock-null resources present in that + // collection + String lockPath = currentPath; + if (lockPath.endsWith("/")) + lockPath = + lockPath.substring(0, lockPath.length() - 1); + Vector currentLockNullResources = + (Vector) lockNullResources.get(lockPath); + if (currentLockNullResources != null) { + Enumeration lockNullResourcesList = + currentLockNullResources.elements(); + while (lockNullResourcesList.hasMoreElements()) { + String lockNullPath = (String) + lockNullResourcesList.nextElement(); + parseLockNullProperties + (req, generatedXML, lockNullPath, type, + properties); } } + } if (stack.isEmpty()) {
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>