You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by bc...@locus.apache.org on 2000/11/21 08:18:34 UTC
cvs commit: jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods PropMethodBase.java WebdavMethodBase.java WebdavMethod.java UnlockMethod.java PutMethod.java PropPatchMethod.java PropFindMethod.java PostMethod.java OptionsMethod.java MoveMethod.java MkcolMethod.java LockMethod.java HeadMethod.java GetMethod.java DeleteMethod.java CopyMethod.java
bcholmes 00/11/20 23:18:34
Modified: src/clients/webdav/src/org/apache/webdav/lib/methods
WebdavMethodBase.java WebdavMethod.java
UnlockMethod.java PutMethod.java
PropPatchMethod.java PropFindMethod.java
PostMethod.java OptionsMethod.java MoveMethod.java
MkcolMethod.java LockMethod.java HeadMethod.java
GetMethod.java DeleteMethod.java CopyMethod.java
Added: src/clients/webdav/src/org/apache/webdav/lib/methods
PropMethodBase.java
Log:
Revisions to the client library for:
- removing unnecessary import statements in methods
- parse the response from PROPFIND
- create an Ant Dav-aware GET task
Revision Changes Path
1.7 +4 -10 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/WebdavMethodBase.java
Index: WebdavMethodBase.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/WebdavMethodBase.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- WebdavMethodBase.java 2000/08/08 04:55:23 1.6
+++ WebdavMethodBase.java 2000/11/21 07:18:09 1.7
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/WebdavMethodBase.java,v 1.6 2000/08/08 04:55:23 remm Exp $
- * $Revision: 1.6 $
- * $Date: 2000/08/08 04:55:23 $
+ * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/WebdavMethodBase.java,v 1.7 2000/11/21 07:18:09 bcholmes Exp $
+ * $Revision: 1.7 $
+ * $Date: 2000/11/21 07:18:09 $
*
* ====================================================================
*
@@ -63,18 +63,12 @@
package org.apache.webdav.lib.methods;
-import java.security.Principal;
import java.io.*;
import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.webdav.lib.State;
import org.apache.webdav.lib.Cookie;
import org.apache.webdav.lib.Header;
-import org.apache.webdav.lib.WebdavClient;
+import org.apache.webdav.lib.WebdavClient;
import org.apache.webdav.lib.WebdavStatus;
1.7 +3 -9 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/WebdavMethod.java
Index: WebdavMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/WebdavMethod.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- WebdavMethod.java 2000/08/08 04:55:23 1.6
+++ WebdavMethod.java 2000/11/21 07:18:10 1.7
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/WebdavMethod.java,v 1.6 2000/08/08 04:55:23 remm Exp $
- * $Revision: 1.6 $
- * $Date: 2000/08/08 04:55:23 $
+ * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/WebdavMethod.java,v 1.7 2000/11/21 07:18:10 bcholmes Exp $
+ * $Revision: 1.7 $
+ * $Date: 2000/11/21 07:18:10 $
*
* ====================================================================
*
@@ -63,14 +63,8 @@
package org.apache.webdav.lib.methods;
-import java.security.Principal;
import java.io.*;
import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.webdav.lib.State;
import org.apache.webdav.lib.Header;
1.2 +3 -9 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/UnlockMethod.java
Index: UnlockMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/UnlockMethod.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- UnlockMethod.java 2000/06/19 07:31:15 1.1
+++ UnlockMethod.java 2000/11/21 07:18:10 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/UnlockMethod.java,v 1.1 2000/06/19 07:31:15 remm Exp $
- * $Revision: 1.1 $
- * $Date: 2000/06/19 07:31:15 $
+ * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/UnlockMethod.java,v 1.2 2000/11/21 07:18:10 bcholmes Exp $
+ * $Revision: 1.2 $
+ * $Date: 2000/11/21 07:18:10 $
*
* ====================================================================
*
@@ -63,14 +63,8 @@
package org.apache.webdav.lib.methods;
-import java.security.Principal;
import java.io.*;
import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.webdav.lib.State;
import org.apache.webdav.lib.Header;
import org.apache.webdav.lib.WebdavStatus;
1.4 +3 -9 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PutMethod.java
Index: PutMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PutMethod.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PutMethod.java 2000/07/03 04:49:52 1.3
+++ PutMethod.java 2000/11/21 07:18:10 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PutMethod.java,v 1.3 2000/07/03 04:49:52 remm Exp $
- * $Revision: 1.3 $
- * $Date: 2000/07/03 04:49:52 $
+ * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PutMethod.java,v 1.4 2000/11/21 07:18:10 bcholmes Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/11/21 07:18:10 $
*
* ====================================================================
*
@@ -63,14 +63,8 @@
package org.apache.webdav.lib.methods;
-import java.security.Principal;
import java.io.*;
import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.webdav.lib.State;
import org.apache.webdav.lib.Header;
import org.apache.webdav.lib.WebdavStatus;
1.4 +4 -20 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PropPatchMethod.java
Index: PropPatchMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PropPatchMethod.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PropPatchMethod.java 2000/07/15 04:17:53 1.3
+++ PropPatchMethod.java 2000/11/21 07:18:10 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PropPatchMethod.java,v 1.3 2000/07/15 04:17:53 remm Exp $
- * $Revision: 1.3 $
- * $Date: 2000/07/15 04:17:53 $
+ * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PropPatchMethod.java,v 1.4 2000/11/21 07:18:10 bcholmes Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/11/21 07:18:10 $
*
* ====================================================================
*
@@ -63,11 +63,8 @@
package org.apache.webdav.lib.methods;
-import java.security.Principal;
import java.io.*;
import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;
@@ -83,7 +80,7 @@
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
*/
public class PropPatchMethod
- extends WebdavMethodBase {
+ extends PropMethodBase {
// ----------------------------------------------------------- Constructors
@@ -253,19 +250,6 @@
printer.writeElement("D", "DAV", "propertyupdate",
WebdavXMLPrinter.CLOSING);
return printer.toString();
- }
-
-
- /**
- * Parse response.
- *
- * @param is Input stream
- */
- public void parseResponse(InputStream is)
- throws IOException {
-
- // Parse the 207 - Multistatus
-
}
1.4 +197 -32 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PropFindMethod.java
Index: PropFindMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PropFindMethod.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PropFindMethod.java 2000/06/28 17:02:38 1.3
+++ PropFindMethod.java 2000/11/21 07:18:10 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PropFindMethod.java,v 1.3 2000/06/28 17:02:38 remm Exp $
- * $Revision: 1.3 $
- * $Date: 2000/06/28 17:02:38 $
+ * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PropFindMethod.java,v 1.4 2000/11/21 07:18:10 bcholmes Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/11/21 07:18:10 $
*
* ====================================================================
*
@@ -63,27 +63,65 @@
package org.apache.webdav.lib.methods;
-import java.security.Principal;
-import java.io.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.StringWriter;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Vector;
+
import org.apache.webdav.lib.State;
import org.apache.webdav.lib.Header;
+import org.apache.webdav.lib.Property;
import org.apache.webdav.lib.WebdavStatus;
+
+import org.apache.webdav.lib.util.DOMUtils;
+import org.apache.webdav.lib.util.DOMWriter;
import org.apache.webdav.lib.util.WebdavXMLPrinter;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
/**
- * PROPFIND Method.
+ * This class implements the WebDAV PROPFIND Method.
+ *
+ * <P> The PROPFIND method retrieves properties defined on the resource
+ * identified by the Request-URI, if the resource does not have any internal
+ * members, or on the resource identified by the Request-URI and potentially
+ * its member resources, if the resource is a collection that has internal
+ * member URIs.
*
+ * <P> A typical request looks like this:
+ *
+ * <PRE>
+ *
+ * PROPFIND /file HTTP/1.1
+ * Host: www.foo.bar
+ * Content-type: text/xml; charset="utf-8"
+ * Content-Length: xxxx
+ *
+ * <?xml version="1.0" encoding="utf-8" ?>
+ * <D:propfind xmlns:D="DAV:">
+ * <D:prop xmlns:R="http://www.foo.bar/boxschema/">
+ * <R:bigbox/>
+ * <R:author/>
+ * <R:DingALing/>
+ * <R:Random/>
+ * </D:prop>
+ * </D:propfind>
+ * </PRE>
+ *
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
*/
public class PropFindMethod
- extends WebdavMethodBase {
+ extends PropMethodBase {
// -------------------------------------------------------------- Constants
@@ -123,8 +161,7 @@
* Request with depth 1.
*/
public static final int DEPTH_1 = 1;
-
-
+
// ----------------------------------------------------------- Constructors
@@ -159,6 +196,12 @@
private int depth = DEPTH_INFINITY;
+ /**
+ * Hashtable of response nodes
+ */
+ private Hashtable responseHashtable = null;
+
+
// ------------------------------------------------------------- Properties
@@ -200,8 +243,8 @@
public int getDepth() {
return depth;
}
-
-
+
+
/**
* Property names setter.
*
@@ -210,19 +253,31 @@
public void setPropertyNames(Enumeration propertyNames) {
this.propertyNames = propertyNames;
}
-
+
+ /**
+ * The namespace abbreviation that prefixes DAV tags
+ */
+ private String prefix = null;
+
// --------------------------------------------------- WebdavMethod Methods
+
+ public void recycle() {
+ super.recycle();
+ prefix = null;
+ responseHashtable = null;
+ }
/**
* Generate additional headers needed by the request.
*
+ * @param host the host
* @param state State token
*/
- public void generateHeaders(State state) {
+ public void generateHeaders(String host, State state) {
- super.generateHeaders(state);
+ super.generateHeaders(host, state);
switch (depth) {
case DEPTH_0:
@@ -272,19 +327,129 @@
return printer.toString();
}
-
+
+ public Enumeration getAllResponseURLs() {
+ return getResponseHashtable().keys();
+ }
+
+
+ protected Hashtable getResponseHashtable() {
+ if (responseHashtable == null) {
+ initResponseHashtable();
+ }
+ return responseHashtable;
+ }
+
+ protected synchronized void initResponseHashtable() {
+ if (responseHashtable == null) {
+ responseHashtable = new Hashtable();
+ Element multistatus = getResponseDocument().getDocumentElement();
+ NodeList hrefList = multistatus.getElementsByTagName(
+ getPrefix() + "href");
+ if (hrefList != null) {
+ for (int i = 0; i < hrefList.getLength(); i++) {
+ try {
+ Element child = (Element) hrefList.item(i);
+ String href = DOMUtils.getTextValue(child);
+ Element response = (Element) child.getParentNode();
+ responseHashtable.put(href, response);
+ } catch (ClassCastException e) {
+ }
+ }
+ }
+ }
+ }
+
+ public Enumeration getResponseProperties(String urlPath) {
+ Vector vector = new Vector();
+
+ try {
+ Element response = (Element) getResponseHashtable().get(urlPath);
+ if (response != null) {
+ NodeList list = response.getElementsByTagName(
+ getPrefix() + "prop");
+ for (int i = 0; i < list.getLength(); i++) {
+ try {
+ Element prop = (Element) list.item(i);
+ NodeList subList = prop.getChildNodes();
+ for (int j = 0; j < subList.getLength(); j++) {
+ try {
+ vector.add(new PropertyImpl(
+ getPrefix(), (Element) subList.item(j)));
+ } catch (ClassCastException e) {
+ }
+ }
+ } catch (ClassCastException e) {
+ }
+ }
+ }
+ } catch (ClassCastException e) {
+ }
+ return vector.elements();
+ }
+
+
+ protected String getPrefix() {
+ if (prefix == null) {
+ prefix = DOMUtils.findDavPrefix(getResponseDocument());
+ }
+ return prefix;
+ }
+
+
+ // --------------------------------------------------- Property Inner Class
- /**
- * Parse response.
- *
- * @param is Input stream
- */
- public void parseResponse(InputStream is)
- throws IOException {
+ class PropertyImpl implements Property {
- // Parse the 207 response.
-
+ PropertyImpl(String prefix, Element element) {
+ this.element = element;
+ this.prefix = prefix;
+ }
+
+ private String prefix;
+ private Element element;
+
+ public String getName() {
+ return element.getTagName();
+ }
+
+ public Element getElement() {
+ return element;
+ }
+
+ public String getPropertyAsString() {
+ return DOMUtils.getTextValue(element);
+ }
+
+ public int getStatusCode() {
+ int status = -1;
+ try {
+ Element propstat = (Element) element.getParentNode().getParentNode();
+
+ NodeList statusList = propstat.getElementsByTagName(prefix + "status");
+ if (statusList != null && statusList.getLength() != 1) {
+ // ????
+ } else {
+ try {
+ Element child = (Element) statusList.item(0);
+ status = DOMUtils.parseStatus(DOMUtils.getTextValue(child));
+ } catch (ClassCastException e) {
+ }
+ }
+ } catch (ClassCastException e) {
+ }
+ return status;
+ }
+
+ public String getOwningURL() {
+ return null;
+ }
+
+ public String toString () {
+ StringWriter tmp = new StringWriter();
+ DOMWriter domWriter = new DOMWriter(tmp, true);
+ domWriter.print(element);
+ return tmp.getBuffer().toString();
+ }
}
-
-
}
1.2 +3 -9 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PostMethod.java
Index: PostMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PostMethod.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PostMethod.java 2000/06/19 07:31:14 1.1
+++ PostMethod.java 2000/11/21 07:18:11 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PostMethod.java,v 1.1 2000/06/19 07:31:14 remm Exp $
- * $Revision: 1.1 $
- * $Date: 2000/06/19 07:31:14 $
+ * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PostMethod.java,v 1.2 2000/11/21 07:18:11 bcholmes Exp $
+ * $Revision: 1.2 $
+ * $Date: 2000/11/21 07:18:11 $
*
* ====================================================================
*
@@ -63,14 +63,8 @@
package org.apache.webdav.lib.methods;
-import java.security.Principal;
import java.io.*;
import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.webdav.lib.State;
import org.apache.webdav.lib.Header;
import org.apache.webdav.lib.WebdavStatus;
1.4 +3 -9 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/OptionsMethod.java
Index: OptionsMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/OptionsMethod.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- OptionsMethod.java 2000/06/27 06:44:02 1.3
+++ OptionsMethod.java 2000/11/21 07:18:11 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/OptionsMethod.java,v 1.3 2000/06/27 06:44:02 remm Exp $
- * $Revision: 1.3 $
- * $Date: 2000/06/27 06:44:02 $
+ * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/OptionsMethod.java,v 1.4 2000/11/21 07:18:11 bcholmes Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/11/21 07:18:11 $
*
* ====================================================================
*
@@ -63,14 +63,8 @@
package org.apache.webdav.lib.methods;
-import java.security.Principal;
import java.io.*;
import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.webdav.lib.State;
import org.apache.webdav.lib.Header;
import org.apache.webdav.lib.WebdavStatus;
1.3 +3 -9 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/MoveMethod.java
Index: MoveMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/MoveMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MoveMethod.java 2000/06/28 00:57:37 1.2
+++ MoveMethod.java 2000/11/21 07:18:11 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/MoveMethod.java,v 1.2 2000/06/28 00:57:37 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/06/28 00:57:37 $
+ * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/MoveMethod.java,v 1.3 2000/11/21 07:18:11 bcholmes Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/11/21 07:18:11 $
*
* ====================================================================
*
@@ -63,14 +63,8 @@
package org.apache.webdav.lib.methods;
-import java.security.Principal;
import java.io.*;
import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.webdav.lib.State;
import org.apache.webdav.lib.Header;
import org.apache.webdav.lib.WebdavStatus;
1.2 +3 -9 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/MkcolMethod.java
Index: MkcolMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/MkcolMethod.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MkcolMethod.java 2000/06/19 07:31:14 1.1
+++ MkcolMethod.java 2000/11/21 07:18:11 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/MkcolMethod.java,v 1.1 2000/06/19 07:31:14 remm Exp $
- * $Revision: 1.1 $
- * $Date: 2000/06/19 07:31:14 $
+ * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/MkcolMethod.java,v 1.2 2000/11/21 07:18:11 bcholmes Exp $
+ * $Revision: 1.2 $
+ * $Date: 2000/11/21 07:18:11 $
*
* ====================================================================
*
@@ -63,14 +63,8 @@
package org.apache.webdav.lib.methods;
-import java.security.Principal;
import java.io.*;
import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.webdav.lib.State;
import org.apache.webdav.lib.Header;
import org.apache.webdav.lib.WebdavStatus;
1.2 +3 -9 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/LockMethod.java
Index: LockMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/LockMethod.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LockMethod.java 2000/06/19 07:31:14 1.1
+++ LockMethod.java 2000/11/21 07:18:12 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/LockMethod.java,v 1.1 2000/06/19 07:31:14 remm Exp $
- * $Revision: 1.1 $
- * $Date: 2000/06/19 07:31:14 $
+ * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/LockMethod.java,v 1.2 2000/11/21 07:18:12 bcholmes Exp $
+ * $Revision: 1.2 $
+ * $Date: 2000/11/21 07:18:12 $
*
* ====================================================================
*
@@ -63,14 +63,8 @@
package org.apache.webdav.lib.methods;
-import java.security.Principal;
import java.io.*;
import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.webdav.lib.State;
import org.apache.webdav.lib.Header;
import org.apache.webdav.lib.WebdavStatus;
1.2 +3 -9 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/HeadMethod.java
Index: HeadMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/HeadMethod.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HeadMethod.java 2000/06/19 07:31:14 1.1
+++ HeadMethod.java 2000/11/21 07:18:12 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/HeadMethod.java,v 1.1 2000/06/19 07:31:14 remm Exp $
- * $Revision: 1.1 $
- * $Date: 2000/06/19 07:31:14 $
+ * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/HeadMethod.java,v 1.2 2000/11/21 07:18:12 bcholmes Exp $
+ * $Revision: 1.2 $
+ * $Date: 2000/11/21 07:18:12 $
*
* ====================================================================
*
@@ -63,14 +63,8 @@
package org.apache.webdav.lib.methods;
-import java.security.Principal;
import java.io.*;
import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.webdav.lib.State;
import org.apache.webdav.lib.Header;
import org.apache.webdav.lib.WebdavStatus;
1.3 +3 -9 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/GetMethod.java
Index: GetMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/GetMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- GetMethod.java 2000/06/26 22:37:53 1.2
+++ GetMethod.java 2000/11/21 07:18:13 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/GetMethod.java,v 1.2 2000/06/26 22:37:53 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/06/26 22:37:53 $
+ * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/GetMethod.java,v 1.3 2000/11/21 07:18:13 bcholmes Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/11/21 07:18:13 $
*
* ====================================================================
*
@@ -63,14 +63,8 @@
package org.apache.webdav.lib.methods;
-import java.security.Principal;
import java.io.*;
import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.webdav.lib.State;
import org.apache.webdav.lib.Header;
import org.apache.webdav.lib.WebdavStatus;
1.3 +3 -9 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/DeleteMethod.java
Index: DeleteMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/DeleteMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DeleteMethod.java 2000/06/28 00:57:37 1.2
+++ DeleteMethod.java 2000/11/21 07:18:13 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/DeleteMethod.java,v 1.2 2000/06/28 00:57:37 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/06/28 00:57:37 $
+ * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/DeleteMethod.java,v 1.3 2000/11/21 07:18:13 bcholmes Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/11/21 07:18:13 $
*
* ====================================================================
*
@@ -63,14 +63,8 @@
package org.apache.webdav.lib.methods;
-import java.security.Principal;
import java.io.*;
import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.webdav.lib.State;
import org.apache.webdav.lib.Header;
import org.apache.webdav.lib.WebdavStatus;
1.3 +3 -9 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/CopyMethod.java
Index: CopyMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/CopyMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CopyMethod.java 2000/06/28 00:57:36 1.2
+++ CopyMethod.java 2000/11/21 07:18:13 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/CopyMethod.java,v 1.2 2000/06/28 00:57:36 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/06/28 00:57:36 $
+ * $Header: /home/cvs/jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/CopyMethod.java,v 1.3 2000/11/21 07:18:13 bcholmes Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/11/21 07:18:13 $
*
* ====================================================================
*
@@ -63,14 +63,8 @@
package org.apache.webdav.lib.methods;
-import java.security.Principal;
import java.io.*;
import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.webdav.lib.State;
import org.apache.webdav.lib.Header;
import org.apache.webdav.lib.WebdavStatus;
1.1 jakarta-slide/src/clients/webdav/src/org/apache/webdav/lib/methods/PropMethodBase.java
Index: PropMethodBase.java
===================================================================
/*
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.webdav.lib.methods;
import java.io.InputStream;
import java.io.IOException;
import java.util.Enumeration;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.webdav.lib.WebdavStatus;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
public class PropMethodBase
extends WebdavMethodBase {
// ----------------------------------------------------- Instance Variables
/**
* Response document
*/
private Document responseDocument = null;
// ------------------------------------------------------------- Properties
/**
* Response document getter.
*
* @return Document response document
*/
public Document getResponseDocument() {
return this.responseDocument;
}
// --------------------------------------------------- WebdavMethod Methods
/**
* Parse response.
*
* @param input Input stream
*/
public void parseResponse(InputStream input)
throws IOException {
// Parse the 207 response.
if (getStatusCode() == WebdavStatus.SC_MULTI_STATUS) {
try {
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
responseDocument = builder.parse(new InputSource(input));
} catch (ParserConfigurationException e) {
// throw new IllegalArgumentException("XML Parser Configuration error", e);
} catch (SAXException e) {
throw new IllegalArgumentException(
"XML parsing error; input is not valid XML: " +
e.getMessage());
}
}
}
}