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 je...@apache.org on 2001/03/06 07:07:11 UTC
cvs commit: jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods XMLResponseMethodBase.java
jericho 01/03/05 22:07:11
Modified: src/webdav/client/src/org/apache/webdav/lib/methods
XMLResponseMethodBase.java
Added: src/webdav/client/src/org/apache/webdav/lib
ResponseEntity.java
Log:
- In order to utilize XML responses,
- Let us make the response entity interface.
Revision Changes Path
1.1 jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/ResponseEntity.java
Index: ResponseEntity.java
===================================================================
/*
* $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/ResponseEntity.java,v 1.1 2001/03/06 06:07:09 jericho Exp $
* $Revision: 1.1 $
* $Date: 2001/03/06 06:07:09 $
*
* ====================================================================
*
* 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;
import java.util.Enumeration;
/**
* The interface for the response entity body formats that provide
* operations for the XML response documents.
*
* @author <a href="mailto:jericho@thinkfree.com">Park, Sung-Gu</a>
* @version $Revision: 1.1 $ $Date: 2001/03/06 06:07:09 $
*/
public interface ResponseEntity {
/**
* Get the href string in the response XML element.
*
* Each response XML element MUST contain an href XML element that gives
* the URI of the resource on which the properties in the prop XML
* element are defined.
*
* @return the href string.
*/
public String getHref();
/**
* Get the status code for use with 207 (Multi-Status).
*
* Unless explicitly prohibited any 2/3/4/5xx series
* response code may be used in a Multi-Status response.
*
* @return the status code.
*/
public int getStatusCode();
/**
* Get the properties in the response XML element.
*
* @return the properties.
*/
public Enumeration getProperties();
}
1.11 +6 -1 jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/XMLResponseMethodBase.java
Index: XMLResponseMethodBase.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/XMLResponseMethodBase.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- XMLResponseMethodBase.java 2001/02/28 02:48:30 1.10
+++ XMLResponseMethodBase.java 2001/03/06 06:07:10 1.11
@@ -80,6 +80,7 @@
import javax.xml.parsers.ParserConfigurationException;
import org.apache.webdav.lib.Property;
+import org.apache.webdav.lib.ResponseEntity;
import org.apache.webdav.lib.WebdavException;
import org.apache.webdav.lib.WebdavStatus;
@@ -304,7 +305,7 @@
/**
* An abstract class that models a DAV:response.
*/
- public abstract class Response {
+ public abstract class Response implements ResponseEntity {
protected Node node = null;
@@ -393,6 +394,7 @@
}
}
+
class SingleResponse extends Response {
private int statusCode = -1;
@@ -413,6 +415,7 @@
}
}
+
/**
* This class implements the Property interface and provides basic
* methods for reading the property.
@@ -463,6 +466,7 @@
}
}
+
/**
* This represents a DAV:resourcetype property. It provides some
* convenience methods for working with the property.
@@ -490,6 +494,7 @@
return (tmp.getLength() > 0);
}
}
+
/**
* This represents a DAV:getlastmodified property. It provides some