gcasper 2003/11/22 05:03:38 Modified: src/blocks/webdav/java/org/apache/cocoon/components/source/impl WebDAVSource.java Log: Fixed setSourceProperty and optimized getSourceProperty Revision Changes Path 1.12 +17 -15 cocoon-2.1/src/blocks/webdav/java/org/apache/cocoon/components/source/impl/WebDAVSource.java Index: WebDAVSource.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/webdav/java/org/apache/cocoon/components/source/impl/WebDAVSource.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- WebDAVSource.java 21 Nov 2003 11:48:14 -0000 1.11 +++ WebDAVSource.java 22 Nov 2003 13:03:38 -0000 1.12 @@ -93,10 +93,10 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; -import org.w3c.dom.Document; -import org.w3c.dom.DocumentFragment; import org.w3c.dom.Element; +import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.w3c.dom.Text; /** * A source implementation to get access to WebDAV repositories. Use it @@ -774,20 +774,18 @@ public SourceProperty getSourceProperty (String namespace, String name) throws SourceException { + Vector propNames = new Vector(1); + propNames.add(new PropertyName(namespace,name)); Enumeration props= null; org.apache.webdav.lib.Property prop = null; try { - Enumeration responses = this.resource.propfindMethod(0); + Enumeration responses = this.resource.propfindMethod(0, propNames); while (responses.hasMoreElements()) { ResponseEntity response = (ResponseEntity)responses.nextElement(); props = response.getProperties(); - while (props.hasMoreElements()) { + if (props.hasMoreElements()) { prop = (Property) props.nextElement(); - - if (namespace.equals(prop.getNamespaceURI()) - && name.equals(prop.getLocalName())){ - return new SourceProperty(prop.getElement()); - } + return new SourceProperty(prop.getElement()); } } } catch (Exception e) { @@ -825,22 +823,26 @@ throws SourceException { try { - Document doc = sourceproperty.getValue().getOwnerDocument(); - DocumentFragment frag = doc.createDocumentFragment(); + Node node = null; NodeList list = sourceproperty.getValue().getChildNodes(); for (int i=0; i