jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r156314 [8/15] - in incubator/jackrabbit/trunk/contrib/jcr-server: ./ client/ client/src/ client/src/java/ client/src/java/org/ client/src/java/org/apache/ client/src/java/org/apache/jackrabbit/ client/src/java/org/apache/jackrabbit/client/ server/ server/src/ server/src/java/ server/src/java/org/ server/src/java/org/apache/ server/src/java/org/apache/jackrabbit/ server/src/java/org/apache/jackrabbit/server/ server/src/java/org/apache/jackrabbit/server/simple/ server/src/java/org/apache/jackrabbit/server/simple/dav/ server/src/java/org/apache/jackrabbit/server/simple/dav/lock/ server/src/java/org/apache/jackrabbit/webdav/ server/src/java/org/apache/jackrabbit/webdav/spi/ server/src/java/org/apache/jackrabbit/webdav/spi/lock/ server/src/java/org/apache/jackrabbit/webdav/spi/nodetype/ server/src/java/org/apache/jackrabbit/webdav/spi/observation/ server/src/java/org/apache/jackrabbit/webdav/spi/search/ server/src/java/org/apache/jackrabbit/webdav/spi/transaction/ server/src/java/org/apache/jackrabbit/webdav/spi/version/ server/src/java/org/apache/jackrabbit/webdav/spi/version/report/ webapp/ webapp/src/ webapp/src/webapp/ webapp/src/webapp/WEB-INF/ webapp/src/webapp/WEB-INF/repository/ webdav/ webdav/src/ webdav/src/java/ webdav/src/java/org/ webdav/src/java/org/apache/ webdav/src/java/org/apache/jackrabbit/ webdav/src/java/org/apache/jackrabbit/webdav/ webdav/src/java/org/apache/jackrabbit/webdav/lock/ webdav/src/java/org/apache/jackrabbit/webdav/observation/ webdav/src/java/org/apache/jackrabbit/webdav/ordering/ webdav/src/java/org/apache/jackrabbit/webdav/property/ webdav/src/java/org/apache/jackrabbit/webdav/search/ webdav/src/java/org/apache/jackrabbit/webdav/transaction/ webdav/src/java/org/apache/jackrabbit/webdav/util/ webdav/src/java/org/apache/jackrabbit/webdav/version/ webdav/src/java/org/apache/jackrabbit/webdav/version/report/
Date Sun, 06 Mar 2005 14:03:11 GMT
Added: incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/webapp/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/webapp/index.jsp?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/webapp/index.jsp (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/webapp/index.jsp Sun Mar  6 06:02:39 2005
@@ -0,0 +1,20 @@
+<%@ page import="org.apache.jackrabbit.server.simple.WebdavServlet,
+		 javax.jcr.Repository,
+		 org.apache.jackrabbit.client.RepositoryAccessServlet"%><%
+%><html>
+<head>
+<title>Jackrabbit Examples</title>
+</head>
+<body>
+<ul>
+<li><a href="<%= request.getContextPath() %><%= WebdavServlet.getPathPrefix() %>/">Repository Browser</a></li>
+<%--
+<li><a href="<%= request.getContextPath() %>/example.jsp">Repository Servlet Example</a></li>
+--%>
+</ul>
+<%
+    Repository rep = RepositoryAccessServlet.getRepository();
+
+%><hr size="1"><em>Powered by <a href="<%= rep.getDescriptor(Repository.REP_VENDOR_URL_DESC) %>"><%= rep.getDescriptor(Repository.REP_NAME_DESC)%></a> version <%= rep.getDescriptor(Repository.REP_VERSION_DESC) %>.</em>
+</body>
+</html>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/webapp/index.jsp
------------------------------------------------------------------------------
    svn = 

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/webapp/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/jcr-server.iml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/jcr-server.iml?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/jcr-server.iml (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/jcr-server.iml Sun Mar  6 06:02:39 2005
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="false" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
+    </content>
+    <orderEntry type="jdk" jdkName="java version &quot;1.4.2_03&quot;" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library name="jcr">
+        <CLASSES>
+          <root url="jar://T:/maven/repository/jsr170/jars/jcr-0.16.2.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library name="jackrabbit">
+        <CLASSES>
+          <root url="jar://T:/maven/repository/jackrabbit/jars/jackrabbit-0.16.2-dev.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library name="jdom">
+        <CLASSES>
+          <root url="jar://T:/maven/repository/jdom/jars/jdom-1.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library name="log4j">
+        <CLASSES>
+          <root url="jar://T:/maven/repository/log4j/jars/log4j-1.2.8.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library name="servletapi">
+        <CLASSES>
+          <root url="jar://T:/maven/repository/servletapi/jars/servletapi-2.3.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library name="jcr-rmi">
+        <CLASSES>
+          <root url="jar://T:/maven/repository/jcr-rmi/jars/jcr-rmi-0.16.2.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntryProperties />
+  </component>
+</module>
+

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/maven.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/maven.xml?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/maven.xml (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/maven.xml Sun Mar  6 06:02:39 2005
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!--
+   Copyright 2004-2005 The Apache Software Foundation or its licensors,
+                       as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<project default="jar">
+
+    <goal name="server-dist">
+        <attainGoal name="jar:install" />
+    </goal>
+</project>

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/maven.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/project.properties
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/project.properties?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/project.properties (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/project.properties Sun Mar  6 06:02:39 2005
@@ -0,0 +1,2 @@
+maven.javadoc.links=http://java.sun.com/j2se/1.4.2/docs/api/,http://www.day.com/maven/jsr170/javadocs/jcr-0.16.1-pfd/
+maven.repo.remote = http://www.ibiblio.org/maven/,http://www.day.com/maven/

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/project.properties
------------------------------------------------------------------------------
    svn = 

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/project.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/project.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/project.xml?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/project.xml (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/project.xml Sun Mar  6 06:02:39 2005
@@ -0,0 +1,119 @@
+<?xml version="1.0"?>
+<!--
+   Copyright 2004-2005 The Apache Software Foundation or its licensors,
+                       as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+  -->
+<project>
+    <!-- ====================================================================== -->
+    <!-- P R O J E C T  D E S C R I P T I O N                                   -->
+    <!-- ====================================================================== -->
+    <extend>${basedir}/../project.xml</extend>
+    <id>jcr-webdav</id>
+    <groupId>jcr-server</groupId>
+    <type>jar</type>
+    <name>JCRWebdavServer Webdav Library</name>
+
+    <!-- ====================================================================== -->
+    <!-- D E P E N D E N C I E S                                                -->
+    <!-- ====================================================================== -->
+    <dependencies>
+        <dependency>
+            <groupId>jsr170</groupId>
+            <artifactId>jcr</artifactId>
+            <version>0.16.2</version>
+            <url>http://www.day.com/maven/jsr170/jars/jcr-0.16.2.jar</url>
+        </dependency>
+        <dependency>
+            <id>jackrabbit</id>
+            <version>0.16.2-dev</version>
+        </dependency>
+        <dependency>
+            <id>jdom</id>
+            <version>1.0</version>
+        </dependency>
+        <dependency>
+            <id>log4j</id>
+            <version>1.2.8</version>
+        </dependency>
+        <dependency>
+            <id>servletapi</id>
+            <version>2.3</version>
+        </dependency>
+        <dependency>
+            <id>jcr-rmi</id>
+            <version>0.16.2</version>
+        </dependency>
+        <!-- dependencies of jackrabbit -->
+        <!--
+        <dependency>
+          <id>concurrent</id>
+          <version>1.3.4</version>
+            <properties>
+                <war.bundle>true</war.bundle>
+            </properties>
+        </dependency>
+        <dependency>
+          <id>commons-collections</id>
+          <version>2.1</version>
+            <properties>
+                <war.bundle>true</war.bundle>
+            </properties>
+        </dependency>
+        <dependency>
+          <groupId>geronimo-spec</groupId>
+          <artifactId>geronimo-spec-jta</artifactId>
+          <version>1.0-M1</version>
+            <properties>
+                <war.bundle>true</war.bundle>
+            </properties>
+        </dependency>
+        <dependency>
+          <groupId>lucene</groupId>
+          <artifactId>lucene</artifactId>
+          <version>1.4.3</version>
+            <properties>
+                <war.bundle>true</war.bundle>
+            </properties>
+        </dependency>
+        <dependency>
+          <groupId>xerces</groupId>
+          <artifactId>xercesImpl</artifactId>
+          <version>2.6.2</version>
+            <properties>
+                <war.bundle>true</war.bundle>
+            </properties>
+        </dependency>
+        -->
+    </dependencies>
+
+    <!-- ====================================================================== -->
+    <!-- B U I L D  D E S C R I P T I O N                                       -->
+    <!-- ====================================================================== -->
+    <build>
+        <sourceDirectory>${basedir}/src/java</sourceDirectory>
+        <resources>
+            <resource>
+                <directory>src/java</directory>
+                <includes>
+                    <include>**/*.xml</include>
+                    <include>**/*.xsd</include>
+                    <include>**/*.properties</include>
+                    <include>**/*.dtd</include>
+                </includes>
+            </resource>
+        </resources>
+    </build>
+
+</project>

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/project.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavConstants.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavConstants.java?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavConstants.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavConstants.java Sun Mar  6 06:02:39 2005
@@ -0,0 +1,140 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.webdav;
+
+import org.jdom.Namespace;
+
+import java.text.SimpleDateFormat;
+
+/**
+ * <code>DavConstants</code> provide constants for request and response
+ * headers, Xml elements and property names defined by
+ * <a href="http://www.ietf.org/rfc/rfc2518.txt">RFC 2518</a>. In addition
+ * common date formats (creation date and modification time) are included.
+ */
+public interface DavConstants {
+
+    /**
+     * Request and response headers and some value constants
+     */
+    //-------------------------------------------------------------- Headers ---
+    public static final String HEADER_DAV = "DAV";
+    public static final String HEADER_DESTINATION = "Destination";
+    public static final String HEADER_IF = "If";
+    public static final String HEADER_AUTHORIZATION = "Authorization";
+
+    //---------------------------------------------------- Lock-Token header ---
+    public static final String HEADER_LOCK_TOKEN = "Lock-Token";
+    public static final String OPAQUE_LOCK_TOKEN_PREFIX = "opaquelocktoken:";
+
+    //------------------------------------------------------- Timeout header ---
+    public static final String HEADER_TIMEOUT = "Timeout";
+    public static final String TIMEOUT_INFINITE = "Infinite";
+    public static final long INFINITE_TIMEOUT = Long.MAX_VALUE;
+    public static final long UNDEFINED_TIMEOUT = Long.MIN_VALUE;
+    
+    //----------------------------------------------------- Overwrite header ---
+    public static final String HEADER_OVERWRITE = "Overwrite";
+    public static final String NO_OVERWRITE = "T";
+
+    //--------------------------------------------------------- Depth header ---
+    public static final String HEADER_DEPTH = "Depth";
+    public static final int DEPTH_INFINITY = Integer.MAX_VALUE;
+    public static final int DEPTH_0 = 0;
+    public static final int DEPTH_1 = 1;
+
+    /**
+     * Default Namespace constant
+     */
+    public static final Namespace NAMESPACE = Namespace.getNamespace("D", "DAV:");
+
+    /**
+     * Xml element names used for response and request body
+     */
+    public static final String XML_ALLPROP = "allprop";
+    public static final String XML_COLLECTION = "collection";
+    public static final String XML_DST = "dst";
+    public static final String XML_HREF = "href";
+    public static final String XML_KEEPALIVE = "keepalive";
+    public static final String XML_LINK = "link";
+    public static final String XML_MULTISTATUS = "multistatus";
+    public static final String XML_OMIT = "omit";
+    public static final String XML_PROP = "prop";
+    public static final String XML_PROPERTYBEHAVIOR = "propertybehavior";
+    public static final String XML_PROPERTYUPDATE = "propertyupdate";
+    public static final String XML_PROPFIND = "propfind";
+    public static final String XML_PROPNAME = "propname";
+    public static final String XML_PROPSTAT = "propstat";
+    public static final String XML_REMOVE = "remove";
+    public static final String XML_RESPONSE = "response";
+    public static final String XML_RESPONSEDESCRIPTION = "responsedescription";
+    public static final String XML_SET = "set";
+    public static final String XML_SOURCE = "source";
+    public static final String XML_STATUS = "status";
+
+    /**
+     * XML element names related to locking
+     */
+    public static final String XML_ACTIVELOCK = "activelock";
+    public static final String XML_DEPTH = "depth";
+    public static final String XML_LOCKTOKEN = "locktoken";
+    public static final String XML_TIMEOUT = "timeout";
+    public static final String XML_LOCKSCOPE = "lockscope";
+    public static final String XML_EXCLUSIVE = "exclusive";
+    public static final String XML_SHARED = "shared";
+    public static final String XML_LOCKENTRY = "lockentry";
+    public static final String XML_LOCKINFO = "lockinfo";
+    public static final String XML_LOCKTYPE = "locktype";
+    public static final String XML_WRITE = "write";
+    public static final String XML_OWNER = "owner";
+
+    /**
+     * Webdav property names as defined by RFC 2518<br>
+     * Note: Microsoft webdav clients as well as Webdrive request additional
+     * property (e.g. href, name, owner, isRootLocation, isCollection)  within the
+     * default namespace, which are are ignored by this implementation, except
+     * for the 'isCollection' property, needed for XP built-in clients.
+     */
+    public static final String PROPERTY_CREATIONDATE = "creationdate";
+    public static final String PROPERTY_DISPLAYNAME = "displayname";
+    public static final String PROPERTY_GETCONTENTLANGUAGE = "getcontentlanguage";
+    public static final String PROPERTY_GETCONTENTLENGTH = "getcontentlength";
+    public static final String PROPERTY_GETCONTENTTYPE = "getcontenttype";
+    public static final String PROPERTY_GETETAG = "getetag";
+    public static final String PROPERTY_GETLASTMODIFIED = "getlastmodified";
+    public static final String PROPERTY_LOCKDISCOVERY = "lockdiscovery";
+    public static final String PROPERTY_RESOURCETYPE = "resourcetype";
+    public static final String PROPERTY_SOURCE = "source";
+    public static final String PROPERTY_SUPPORTEDLOCK = "supportedlock";
+
+    //--------------------------------------------------- Propfind constants ---
+    public static final int PROPFIND_BY_PROPERTY = 0;
+    public static final int PROPFIND_ALL_PROP = 1;
+    public static final int PROPFIND_PROPERTY_NAMES = 2;
+
+    //--------------------------------------------------------- date formats ---
+    /**
+     * modificationDate date format per RFC 1123
+     */
+    public static SimpleDateFormat modificationDateFormat =
+	new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz");
+
+    /**
+     * Simple date format for the creation date ISO representation (partial).
+     */
+    public static SimpleDateFormat creationDateFormat =
+	new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavConstants.java
------------------------------------------------------------------------------
    svn = 

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavException.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavException.java?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavException.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavException.java Sun Mar  6 06:02:39 2005
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.webdav;
+
+import org.apache.log4j.Logger;
+import org.jdom.Element;
+
+import java.util.Properties;
+import java.io.IOException;
+
+/**
+ * <code>DavException</code> extends the {@link Exception} class in order
+ * to simplify handling of exceptional situations occuring during processing
+ * of WebDAV requests and provides possibility to retrieve an Xml representation
+ * of the error.
+ */
+public class DavException extends Exception {
+
+    private static Logger log = Logger.getLogger(DavException.class);
+    private static Properties statusPhrases = new Properties();
+    static {
+        try {
+            statusPhrases.load(DavException.class.getResourceAsStream("statuscode.properties"));
+        } catch (IOException e) {
+            log.error("Failed to load status properties: "+ e.getMessage());
+        }
+    }
+
+    private static final String XML_ERROR = "error";
+
+    private int errorCode = DavServletResponse.SC_INTERNAL_SERVER_ERROR;
+    private Element conditionElement;
+
+    /**
+     * Create a new <code>DavException</code>.
+     *
+     * @param errorCode integer specifying any of the status codes defined by
+     * {@link DavServletResponse}.
+     * @param conditionElement
+     */
+    public DavException(int errorCode, Element conditionElement) {
+        super(conditionElement.getText());
+        this.errorCode = errorCode;
+        this.conditionElement = conditionElement;
+        log.debug("DavException: (" + errorCode + ") " + conditionElement.toString());
+    }
+
+    /**
+     * Create a new <code>DavException</code>.
+     *
+     * @param errorCode integer specifying any of the status codes defined by
+     * {@link DavServletResponse}.
+     * @param message Human readable error message.
+     */
+    public DavException(int errorCode, String message) {
+        super(message);
+        this.errorCode = errorCode;
+        log.debug("DavException: (" + errorCode + ") " + message);
+    }
+
+    /**
+     * Create a new <code>DavException</code>.
+     *
+     * @param errorCode integer specifying any of the status codes defined by
+     * {@link DavServletResponse}.
+     */
+    public DavException(int errorCode) {
+        this(errorCode, statusPhrases.getProperty(String.valueOf(errorCode)));
+    }
+
+    /**
+     * Return the error code attached to this <code>DavException</code>.
+     *
+     * @return errorCode
+     */
+    public int getErrorCode() {
+        return errorCode;
+    }
+
+    /**
+     * Returns the Xml representation of this <code>DavException</code>. In case
+     * no {@link Element} has been passed to the constructor, an empty DAV:error
+     * element is returned.
+     *
+     * @return Xml representation of this exception.
+     */
+    public Element getError() {
+        Element error = new Element(XML_ERROR, DavConstants.NAMESPACE);
+        if (conditionElement != null) {
+            error.addContent(conditionElement);
+        }
+        return error;
+    }
+
+    /**
+     * Return the status phrase corresponding to the error code attached to
+     * this <code>DavException</code>.
+     *
+     * @return status phrase corresponding to the error code.
+     * @see #getErrorCode()
+     */
+    public String getStatusPhrase() {
+        return getStatusPhrase(errorCode);
+    }
+
+    /**
+     * Returns the status phrase for the given error code.
+     *
+     * @param errorCode
+     * @return status phrase corresponding to the given error code.
+     */
+    public static String getStatusPhrase(int errorCode) {
+        return statusPhrases.getProperty(errorCode+"");
+    }
+}
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavException.java
------------------------------------------------------------------------------
    svn = 

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavLocatorFactory.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavLocatorFactory.java?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavLocatorFactory.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavLocatorFactory.java Sun Mar  6 06:02:39 2005
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.webdav;
+
+/**
+ * <code>DavLocatorFactory</code>...
+ */
+public interface DavLocatorFactory {
+
+    /**
+     * Create a new <code>DavResourceLocator</code>.
+     *
+     * @param prefix
+     * @param requestHandle
+     * @return
+     */
+    public DavResourceLocator createResourceLocator(String prefix, String requestHandle);
+
+    /**
+     * Create a new <code>DavResourceLocator</code>.
+     * 
+     * @param prefix
+     * @param workspacePath
+     * @param resourcePath
+     * @return
+     */
+    public DavResourceLocator createResourceLocator(String prefix, String workspacePath, String resourcePath);
+}
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavLocatorFactory.java
------------------------------------------------------------------------------
    svn = 

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavLocatorFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavMethods.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavMethods.java?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavMethods.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavMethods.java Sun Mar  6 06:02:39 2005
@@ -0,0 +1,300 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.webdav;
+
+import org.apache.log4j.Logger;
+
+import java.util.HashMap;
+
+/**
+ * <code>DavMethods</code> defines constants for the WebDAV METHODS.
+ */
+public class DavMethods {
+
+    private static Logger log = Logger.getLogger(DavMethods.class);
+
+    /**
+     * A hashmap of webdav METHODS
+     */
+    private static HashMap methodMap = new HashMap();
+
+    /**
+     * An array of method codes that are affected by a Label header
+     * @see org.apache.jackrabbit.webdav.version.DeltaVConstants#HEADER_LABEL
+     */
+    private static int[] labelMethods;
+
+    /**
+     * The webdav OPTIONS method and public constant
+     */
+    public static final int DAV_OPTIONS = 1;
+    private static final String METHOD_OPTIONS = "OPTIONS";
+
+    /**
+     * The webdav GET method and public constant
+     */
+    public static final int DAV_GET = DAV_OPTIONS + 1;
+    private static final String METHOD_GET = "GET";
+
+    /**
+     * The webdav HEAD method and public constant
+     */
+    public static final int DAV_HEAD = DAV_GET + 1;
+    private static final String METHOD_HEAD = "HEAD";
+
+
+    /**
+     * The webdav POST method and public constant
+     */
+    public static final int DAV_POST = DAV_HEAD + 1;
+    private static final String METHOD_POST = "POST";
+
+
+    /** The webdav DELETE method and public constant */
+    public static final int DAV_DELETE = DAV_POST + 1;
+    private static final String METHOD_DELETE = "DELETE";
+
+
+    /** The webdav PUT method and public constant */
+    public static final int DAV_PUT = DAV_DELETE + 1;
+    private static final String METHOD_PUT = "PUT";
+
+
+    /**
+     * The webdav PROPFIND method and public constant as defined by
+     * <a href="http://www.ietf.org/rfc/rfc2518.txt">RFC 2518</a>.
+     */
+    public static final int DAV_PROPFIND = DAV_PUT + 1;
+    private static final String METHOD_PROPFIND = "PROPFIND";
+
+
+    /**
+     * The webdav PROPPATCH method and public constant as defined by
+     * <a href="http://www.ietf.org/rfc/rfc2518.txt">RFC 2518</a>
+     */
+    public static final int DAV_PROPPATCH = DAV_PROPFIND + 1;
+    private static final String METHOD_PROPPATCH = "PROPPATCH";
+
+
+    /**
+     * The webdav MKCOL (make collection) method and public constant as defined by
+     * <a href="http://www.ietf.org/rfc/rfc2518.txt">RFC 2518</a>
+     */
+    public static final int DAV_MKCOL = DAV_PROPPATCH + 1;
+    private static final String METHOD_MKCOL = "MKCOL";
+
+
+    /**
+     * The webdav COPY method and public constant as defined by
+     * <a href="http://www.ietf.org/rfc/rfc2518.txt">RFC 2518</a>
+     */
+    public static final int DAV_COPY = DAV_MKCOL + 1;
+    private static final String METHOD_COPY = "COPY";
+
+
+    /**
+     * The webdav MOVE method and public constant as defined by
+     * <a href="http://www.ietf.org/rfc/rfc2518.txt">RFC 2518</a>
+     */
+    public static final int DAV_MOVE = DAV_COPY + 1;
+    private static final String METHOD_MOVE = "MOVE";
+
+
+    /**
+     * The webdav LOCK method and public constant as defined by
+     * <a href="http://www.ietf.org/rfc/rfc2518.txt">RFC 2518</a>
+     */
+    public static final int DAV_LOCK = DAV_MOVE + 1;
+    private static final String METHOD_LOCK = "LOCK";
+
+
+    /**
+     * The webdav UNLOCK method and public constant as defined by
+     * <a href="http://www.ietf.org/rfc/rfc2518.txt">RFC 2518</a>
+     */
+    public static final int DAV_UNLOCK = DAV_LOCK + 1;
+    private static final String METHOD_UNLOCK = "UNLOCK";
+
+
+    /**
+     * The webdav ORDERPATCH method and public constant
+     * defined by <a href="http://www.ietf.org/rfc/rfc3648.txt">RFC 3648</a>.
+     */
+    public static final int DAV_ORDERPATCH = DAV_UNLOCK + 1;
+    private static final String METHOD_ORDERPATCH = "ORDERPATCH";
+
+
+    /**
+     * The webdav SUBSCRIBE method and public constant.<br>
+     * NOTE: This method is not defined by any of the Webdav RFCs
+     */
+    public static final int DAV_SUBSCRIBE = DAV_ORDERPATCH + 1;
+    private static final String METHOD_SUBSCRIBE = "SUBSCRIBE";
+
+
+    /**
+     * The webdav UNSUBSCRIBE method and public constant<br>
+     * NOTE: This method is not defined by any of the Webdav RFCs
+     */
+    public static final int DAV_UNSUBSCRIBE = DAV_SUBSCRIBE + 1;
+    private static final String METHOD_UNSUBSCRIBE = "UNSUBSCRIBE";
+
+
+    /**
+     * The webdav POLL method and public constant<br>
+     * NOTE: This method is not defined by any of the Webdav RFCs
+     */
+    public static final int DAV_POLL = DAV_UNSUBSCRIBE + 1;
+    private static final String METHOD_POLL = "POLL";
+
+
+    /**
+     * The webdav SEARCH method and public constant as defined by the
+     * Webdav Search internet draft.
+     */
+    public static final int DAV_SEARCH = DAV_POLL + 1;
+    private static final String METHOD_SEARCH = "SEARCH";
+
+
+    /**
+     * The webdav REPORT method and public constant defined by
+     * <a href="http://www.ietf.org/rfc/rfc3253.txt">RFC 3253</a>
+     */
+    public static final int DAV_REPORT = DAV_SEARCH + 1;
+    private static final String METHOD_REPORT = "REPORT";
+
+
+    /**
+     * The webdav VERSION-CONTROL method and public constant defined by
+     * <a href="http://www.ietf.org/rfc/rfc3253.txt">RFC 3253</a>
+     */
+    public static final int DAV_VERSION_CONTROL = DAV_REPORT + 1;
+    private static final String METHOD_VERSION_CONTROL = "VERSION-CONTROL";
+
+    /**
+     * The webdav CHECKIN method and public constant defined by
+     * <a href="http://www.ietf.org/rfc/rfc3253.txt">RFC 3253</a>
+     */
+    public static final int DAV_CHECKIN = DAV_VERSION_CONTROL + 1;
+    private static final String METHOD_CHECKIN = "CHECKIN";
+
+    /**
+     * The webdav CHECKOUT method and public constant defined by
+     * <a href="http://www.ietf.org/rfc/rfc3253.txt">RFC 3253</a>
+     */
+    public static final int DAV_CHECKOUT = DAV_CHECKIN + 1;
+    private static final String METHOD_CHECKOUT = "CHECKOUT";
+
+    /**
+     * The webdav UNCHECKOUT method and public constant defined by
+     * <a href="http://www.ietf.org/rfc/rfc3253.txt">RFC 3253</a>
+     */
+    public static final int DAV_UNCHECKOUT = DAV_CHECKOUT + 1;
+    private static final String METHOD_UNCHECKOUT = "UNCHECKOUT";
+
+    /**
+     * The webdav LABEL method and public constant defined by
+     * <a href="http://www.ietf.org/rfc/rfc3253.txt">RFC 3253</a>
+     */
+    public static final int DAV_LABEL = DAV_UNCHECKOUT + 1;
+    private static final String METHOD_LABEL = "LABEL";
+
+    /**
+     * The webdav MERGE method and public constant defined by
+     * <a href="http://www.ietf.org/rfc/rfc3253.txt">RFC 3253</a>
+     */
+    public static final int DAV_MERGE = DAV_LABEL + 1;
+    private static final String METHOD_MERGE = "MERGE";
+
+    /**
+     * The webdav UPDATE method and public constant defined by
+     * <a href="http://www.ietf.org/rfc/rfc3253.txt">RFC 3253</a>
+     */
+    public static final int DAV_UPDATE = DAV_MERGE + 1;
+    private static final String METHOD_UPDATE = "UPDATE";
+
+    /**
+     * The webdav MKWORKSPACE method and public constant defined by
+     * <a href="http://www.ietf.org/rfc/rfc3253.txt">RFC 3253</a>
+     */
+    public static final int DAV_MKWORKSPACE = DAV_UPDATE + 1;
+    private static final String METHOD_MKWORKSPACE = "MKWORKSPACE";
+
+    /**
+     * Returns webdav method type code, error result <= 0
+     * Valid type codes > 0
+     */
+    public static int getMethodCode(String method) {
+        Integer code = (Integer) methodMap.get(method.toUpperCase());
+        if (code != null) {
+            return code.intValue();
+        }
+        return 0;
+    }
+
+    /**
+     * Static intializer for methodTable hashmap
+     */
+    private static void addMethodCode(String method, int code) {
+        methodMap.put(method, new Integer(code));
+    }
+
+    /**
+     *  Webdav Method table
+     */
+    static {
+        addMethodCode(METHOD_OPTIONS, DAV_OPTIONS);
+        addMethodCode(METHOD_GET, DAV_GET);
+        addMethodCode(METHOD_HEAD, DAV_HEAD);
+        addMethodCode(METHOD_POST, DAV_POST);
+        addMethodCode(METHOD_PUT, DAV_PUT);
+        addMethodCode(METHOD_DELETE, DAV_DELETE);
+        addMethodCode(METHOD_PROPFIND, DAV_PROPFIND);
+        addMethodCode(METHOD_PROPPATCH, DAV_PROPPATCH);
+        addMethodCode(METHOD_MKCOL, DAV_MKCOL);
+        addMethodCode(METHOD_COPY, DAV_COPY);
+        addMethodCode(METHOD_MOVE, DAV_MOVE);
+        addMethodCode(METHOD_LOCK, DAV_LOCK);
+        addMethodCode(METHOD_UNLOCK, DAV_UNLOCK);
+        addMethodCode(METHOD_ORDERPATCH, DAV_ORDERPATCH);
+        addMethodCode(METHOD_SUBSCRIBE, DAV_SUBSCRIBE);
+        addMethodCode(METHOD_UNSUBSCRIBE, DAV_UNSUBSCRIBE);
+        addMethodCode(METHOD_POLL, DAV_POLL);
+        addMethodCode(METHOD_SEARCH, DAV_SEARCH);
+        addMethodCode(METHOD_REPORT, DAV_REPORT);
+        addMethodCode(METHOD_VERSION_CONTROL, DAV_VERSION_CONTROL);
+        addMethodCode(METHOD_CHECKIN, DAV_CHECKIN);
+        addMethodCode(METHOD_CHECKOUT, DAV_CHECKOUT);
+        addMethodCode(METHOD_UNCHECKOUT, DAV_UNCHECKOUT);
+        addMethodCode(METHOD_LABEL, DAV_LABEL);
+        addMethodCode(METHOD_MERGE, DAV_MERGE);
+        addMethodCode(METHOD_UPDATE, DAV_UPDATE);
+        addMethodCode(METHOD_MKWORKSPACE, DAV_MKWORKSPACE);
+
+        labelMethods = new int[] { DAV_GET, DAV_HEAD, DAV_OPTIONS, DAV_PROPFIND,
+                                   DAV_LABEL, DAV_COPY };
+    }
+
+    public static boolean isMethodAffectedByLabel(String method) {
+        int code = getMethodCode(method);
+        for (int i = 0; i < labelMethods.length; i++) {
+            if (code == labelMethods[i]) {
+                return true;
+            }
+        }
+        return false;
+    }
+}
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavMethods.java
------------------------------------------------------------------------------
    svn = 

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavMethods.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResource.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResource.java?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResource.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResource.java Sun Mar  6 06:02:39 2005
@@ -0,0 +1,315 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.webdav;
+
+import org.apache.jackrabbit.webdav.property.*;
+import org.apache.jackrabbit.webdav.lock.*;
+
+import java.io.InputStream;
+
+/**
+ * <code>DavResource</code> provides standard WebDAV functionality as specified
+ * by <a href="http://www.ietf.org/rfc/rfc2518.txt">RFC 2518</a>.
+ */
+public interface DavResource {
+
+    /**
+     * Constant for WebDAV 1 and 2 compliance class as is represented by this
+     * resource.
+     */
+    public static final String COMPLIANCE_CLASS = "1, 2";
+
+    /**
+     * String constant representing the WebDAV 1 and 2 method set.
+     */
+    public static final String METHODS = "OPTIONS, GET, HEAD, POST, TRACE, PROPFIND, PROPPATCH, COPY, PUT, DELETE, MOVE, LOCK, UNLOCK";
+
+    /**
+     * Constant indicating the undefined modification time.
+     */
+    public static final long UNDEFINED_MODIFICATIONTIME = -1;
+
+    /**
+     * Returns a comma separted list of all compliance classes the given
+     * resource is fulfilling.
+     *
+     * @return compliance classes
+     */
+    public String getComplianceClass();
+
+    /**
+     * Returns a comma separated list of all METHODS supported by the given
+     * resource.
+     *
+     * @return METHODS supported by this resource.
+     */
+    public String getSupportedMethods();
+
+    /**
+     * Returns true if this webdav resource represents an existing repository item.
+     *
+     * @return true, if the resource represents an existing repository item.
+     */
+    public boolean exists();
+
+    /**
+     * Returns true if this webdav resource has the resourcetype 'collection'.
+     *
+     * @return true if the resource represents a collection resource.
+     */
+    public boolean isCollection();
+
+    /**
+     * Returns the display name of this resource.
+     *
+     * @return display name.
+     */
+    public String getDisplayName();
+
+    /**
+     * Returns the {@link DavResourceLocator locator} object for this webdav resource,
+     * which encapsulates the information for building the complete 'href'.
+     *
+     * @return the locator for this resource.
+     * @see #getResourcePath()
+     * @see #getHref()
+     */
+    public DavResourceLocator getLocator();
+
+    /**
+     * Returns the path of the hierarchy element defined by this <code>DavResource</code>.
+     * This method is a shortcut for <code>DavResource.getLocator().getResourcePath()</code>.
+     *
+     * @return path of the element defined by this <code>DavResource</code>.
+     */
+    public String getResourcePath();
+
+    /**
+     * Returns the absolute href of this resource as returned in the
+     * multistatus response body.
+     *
+     * @return href
+     */
+    public String getHref();
+
+    /**
+     * Return the time of the last modification or -1 if the modification time
+     * could not be retrieved.
+     *
+     * @return time of last modification or -1.
+     */
+    public long getModificationTime();
+
+    /**
+     * Returns a stream to the resource content in order to respond to a 'GET'
+     * request.
+     *
+     * @return stream to the resource content.
+     */
+    public InputStream getStream();
+
+    /**
+     * Returns an array of all {@link DavPropertyName property names} available
+     * on this resource.
+     *
+     * @return an array of property names.
+     */
+    public DavPropertyName[] getPropertyNames();
+
+    /**
+     * Return the webdav property with the specified name.
+     *
+     * @param name name of the webdav property
+     * @return the {@link DavProperty} with the given name or <code>null</code>
+     * if the property does not exist.
+     */
+    public DavProperty getProperty(DavPropertyName name);
+
+    /**
+     * Returns all webdav properties present on this resource.
+     *
+     * @return a {@link DavPropertySet} containing all webdav property
+     * of this resource.
+     */
+    public DavPropertySet getProperties();
+
+    /**
+     * Add/Set the specified property on this resource.
+     *
+     * @param property
+     * @throws DavException if an error occurs
+     */
+    public void setProperty(DavProperty property) throws DavException;
+
+    /**
+     * Remove the specified property from this resource.
+     *
+     * @param propertyName
+     * @throws DavException if an error occurs
+     */
+    public void removeProperty(DavPropertyName propertyName) throws DavException;
+
+    /**
+     * Retrieve the resource this resource is internal member of.
+     *
+     * @return resource this resource is an internal member of. In case this resource
+     * is the root <code>null</code> is returned.
+     */
+    public DavResource getCollection();
+
+    /**
+     * Add the given resource as an internal member to this resource.
+     *
+     * @param resource {@link DavResource} to be added as internal member.
+     * @param in {@link java.io.InputStream} providing the content for the
+     * internal member.
+     * @throws DavException
+     */
+    public void addMember(DavResource resource, InputStream in)
+            throws DavException;
+
+    /**
+     * Add the given resource as an internal member to this resource.
+     *
+     * @param resource webdav resource to be added as member.
+     * @throws DavException
+     */
+    public void addMember(DavResource resource) throws DavException;
+
+    /**
+     * Returns an iterator over all internal members.
+     *
+     * @return a {@link DavResourceIterator) over all internal members.
+     */
+    public DavResourceIterator getMembers();
+
+    /**
+     * Removes the specified member from this resource.
+     *
+     * @throws DavException
+     */
+    public void removeMember(DavResource member) throws DavException;
+
+    /**
+     * Move this DavResource to the given destination resource
+     *
+     * @param destination
+     * @throws DavException
+     */
+    public void move(DavResource destination) throws DavException;
+
+    /**
+     * Copy this DavResource to the given destination resource
+     *
+     * @param destination
+     * @param shallow
+     * @throws DavException
+     */
+    public void copy(DavResource destination, boolean shallow) throws DavException;
+
+    /**
+     * Returns true, if the this resource allows locking. NOTE, that this method
+     * does not define, whether a lock/unlock can be successfully executed.
+     *
+     * @return true, if this resource supports any locking.
+     * @param type
+     * @param scope
+     */
+    public boolean isLockable(Type type, Scope scope);
+
+    /**
+     * Returns true if a lock applies to this resource. This may be either a
+     * lock on this resource itself or a deep lock inherited from a collection
+     * above this resource.<br>
+     * Note, that true is returned whenever a lock applies to that resource even
+     * if the lock is expired or not effective due to the fact that the request
+     * provides the proper lock token.
+     *
+     * @return true if a lock applies to this resource.
+     * @param type
+     */
+    public boolean hasLock(Type type, Scope scope);
+
+    /**
+     * Return the lock present on this webdav resource or <code>null</code>
+     * if the resource is either not locked or not lockable at all. Note, that
+     * a resource may have a lock that is inherited by a deep lock inforced on
+     * one of its 'parent' resources.
+     *
+     * @return lock information of this resource or <code>null</code> if this
+     * resource has no lock applying it. If an error occurs while retrieving the
+     * lock information <code>null</code> is returned as well.
+     * @param type
+     */
+    public ActiveLock getLock(Type type, Scope scope) ;
+
+    /**
+     * Returns an array of all locks applied to the given resource.
+     *
+     * @return array of locks. The array is empty if there are no locks applied
+     * to this resource.
+     */
+    public ActiveLock[] getLocks();
+
+    /**
+     * Lock this webdav resource with the information retrieve from the request
+     * and return the resulting lockdiscovery object.
+     *
+     * @param reqLockInfo lock info as retrieved from the request.
+     * @return lockdiscovery object to be returned in the response. If the lock
+     * could not be obtained a <code>DavException</code> is thrown.
+     * @throws DavException if the lock could not be obtained.
+     */
+    public ActiveLock lock(LockInfo reqLockInfo) throws DavException;
+
+    /**
+     * Refresh an existing lock by resetting the timeout.
+     *
+     * @param reqLockInfo lock info as retrieved from the request.
+     * @param lockToken identifying the lock to be refreshed.
+     * @return lockdiscovery object to be returned in the response body. If the lock
+     * could not be refreshed a <code>DavException</code> is thrown.
+     * @throws DavException if the lock could not be refreshed.
+     */
+    public ActiveLock refreshLock(LockInfo reqLockInfo, String lockToken) throws DavException;
+
+    /**
+     * Remove the lock indentified by the included lock token from this resource.
+     * This method will return false if the unlocking did not succeed.
+     *
+     * @param lockToken indentifying the lock to be removed.
+     * @throws DavException if the lock could not be removed.
+     */
+    public void unlock(String lockToken) throws DavException;
+
+    /**
+     * Add an external {@link LockManager} to this resource. This method may
+     * throw {@link UnsupportedOperationException} if the resource does handle
+     * locking itself.
+     *
+     * @param lockmgr
+     * @see LockManager
+     */
+    public void addLockManager(LockManager lockmgr);
+
+    /**
+     * Return the <code>DavResourceFactory</code> that created this resource.
+     *
+     * @return the factory that created this resource.
+     */
+    public DavResourceFactory getFactory();
+}
+

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResource.java
------------------------------------------------------------------------------
    svn = 

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResource.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceFactory.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceFactory.java?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceFactory.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceFactory.java Sun Mar  6 06:02:39 2005
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.webdav;
+
+/**
+ * <code>DavResourceFactory</code> interface defines a single method for creating
+ * {@link DavResource} objects.
+ */
+public interface DavResourceFactory {
+
+    /**
+     * Create a {@link DavResource} object from the given locator, request and response
+     * objects.
+     *
+     * @param locator locator of the resource
+     * @param request
+     * @param response
+     * @return a new <code>DavResource</code> object.
+     * @throws DavException
+     */
+    public DavResource createResource(DavResourceLocator locator, DavServletRequest request, DavServletResponse response) throws DavException;
+
+    /**
+     * Create a new {@link DavResource} object from the given locator and session.
+     *
+     * @param locator
+     * @param session
+     * @return a new <code>DavResource</code> object. 
+     * @throws DavException
+     */
+    public DavResource createResource(DavResourceLocator locator, DavSession session) throws DavException;
+}
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceFactory.java
------------------------------------------------------------------------------
    svn = 

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceIterator.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceIterator.java?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceIterator.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceIterator.java Sun Mar  6 06:02:39 2005
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.webdav;
+
+import java.util.Iterator;
+
+/**
+ * DavResourceIterator extends the <code>Iterator</code> interface. Additional
+ * METHODS allow to retrieve the next {@link DavResource} from the iterator
+ * and the iterators size.
+ */
+public interface DavResourceIterator extends Iterator {
+
+    /**
+     * Returns the next {@link DavResource} in the iterator
+     * @return the next {@link DavResource}
+     */
+    public DavResource nextResource();
+
+    /**
+     * Return the number of {@link DavResource}s in the iterator.
+     * @return number of elements in the iterator.
+     */
+    public int size();
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceIterator.java
------------------------------------------------------------------------------
    svn = 

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceIterator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceIteratorImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceIteratorImpl.java?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceIteratorImpl.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceIteratorImpl.java Sun Mar  6 06:02:39 2005
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.webdav;
+
+import org.apache.log4j.Logger;
+
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * <code>DavResourceIteratorImpl</code> implementation of the {@link DavResourceIterator}
+ * interface.<br>
+ * NOTE: {@link #remove()} is not implemented.
+ */
+public class DavResourceIteratorImpl implements DavResourceIterator {
+
+    private static Logger log = Logger.getLogger(DavResourceIteratorImpl.class);
+
+    private Iterator it;
+    private int size;
+
+    /**
+     * Create a new DavResourceIterator from the specified list.
+     * @param list
+     */
+    public DavResourceIteratorImpl(List list) {
+        it = list.iterator();
+        size = list.size();
+    }
+
+    /**
+     * @see DavResourceIterator#hasNext()
+     */
+    public boolean hasNext() {
+        return it.hasNext();
+    }
+
+    /**
+     * @see DavResourceIterator#next()
+     */
+    public Object next() {
+        return it.next();
+    }
+
+    /**
+     * @see DavResourceIterator#nextResource()
+     */
+    public DavResource nextResource() {
+        return (DavResource) next();
+    }
+
+    /**
+     * Returns the size of the initial list.
+     *
+     * @see DavResourceIterator#size()
+     */
+    public int size() {
+        return size;
+    }
+
+    /**
+     * @see DavResourceIterator#remove()
+     */
+    public void remove() {
+        throw new UnsupportedOperationException("Remove not allowed with DavResourceIteratorImpl");
+    }
+}
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceIteratorImpl.java
------------------------------------------------------------------------------
    svn = 

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceIteratorImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceLocator.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceLocator.java?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceLocator.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceLocator.java Sun Mar  6 06:02:39 2005
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.webdav;
+
+/**
+ * <code>DavResourceLocator</code>...
+ */
+public interface DavResourceLocator {
+
+    /**
+     * Return the prefix used to build the complete href of the resource as
+     * required for the {@link DavConstants#XML_HREF href Xml} element.
+     * This includes scheme and host information as well as constant prefixes.
+     * However, this must not include workspace prefix.
+     *
+     * @return prefix needed in order to build the href from a resource path.
+     * @see #getResourcePath()
+     */
+    public String getPrefix();
+
+    /**
+     * Return the resource path.
+     *
+     * @return resource path
+     */
+    public String getResourcePath();
+
+    /**
+     * Return the path of the workspace the resource identified by this
+     * locator is member of.
+     *
+     * @return path of the workspace
+     */
+    public String getWorkspacePath();
+
+    /**
+     * Return the name of the workspace the resource identified by this
+     * locator is member of.
+     *
+     * @return workspace name
+     */
+    public String getWorkspaceName();
+
+    /**
+     * Returns true if the specified locator refers to a resource within the
+     * same workspace.
+     *
+     * @param locator
+     * @return true if both paths are in the same workspace.
+     */
+    public boolean isSameWorkspace(DavResourceLocator locator);
+
+    /**
+     * Returns true if the specified workspace name equals to the workspace
+     * name defined with this locator.
+     *
+     * @param workspaceName
+     * @return true if workspace names are equal.
+     */
+    public boolean isSameWorkspace(String workspaceName);
+
+    /**
+     * Return the 'href' representation of this locator object.
+     *
+     * @param isCollection
+     * @return 'href' representation of this path
+     * @see DavConstants#XML_HREF
+     * @see DavResource#getHref()
+     */
+    public String getHref(boolean isCollection);
+
+    /**
+     * Returns true if this <code>DavResourceLocator</code> represents the root
+     * locator that would be requested with 'hrefPrefix'+'pathPrefix' with or
+     * without a trailing '/'.
+     *
+     * @return true if this locator object belongs to the root resource.
+     */
+    public boolean isRootLocation();
+
+    /**
+     * Return the locator factory that created this locator.
+     *
+     * @return the locator factory
+     */
+    public DavLocatorFactory getFactory();
+}
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceLocator.java
------------------------------------------------------------------------------
    svn = 

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavResourceLocator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavServletRequest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavServletRequest.java?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavServletRequest.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavServletRequest.java Sun Mar  6 06:02:39 2005
@@ -0,0 +1,201 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.webdav;
+
+import org.apache.jackrabbit.webdav.property.DavPropertySet;
+import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
+import org.apache.jackrabbit.webdav.lock.LockInfo;
+import org.jdom.Document;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * <code>DavServletRequest</code> extends the HttpServletRequest by Webdav
+ * specific METHODS.
+ */
+public interface DavServletRequest extends HttpServletRequest {
+
+    /**
+     * Sets the <code>DavSession</code> to this request.
+     *
+     * @param session
+     */
+    public void setDavSession(DavSession session);
+
+    /**
+     * Returns the {@link DavSession} created for this request.
+     *
+     * @return session for this resource
+     */
+    public DavSession getDavSession();
+
+    /**
+     * Return the locator of the requested {@link DavResource resource}.
+     *
+     * @return locator of the requested {@link DavResource resource}.
+     */
+    public DavResourceLocator getRequestLocator();
+
+    /**
+     * Parse the {@link DavConstants#HEADER_DESTINATION Destination header}
+     * and return the locator of the corresponding {@link DavResource resource}.
+     *
+     * @return locator of the resource specified with the Destination header.
+     * @see DavConstants#HEADER_DESTINATION
+     */
+    public DavResourceLocator getDestinationLocator();
+
+    /**
+     * Returns true if the {@link DavConstants#HEADER_OVERWRITE Overwrite header}
+     * is set to 'T' thus instructing the server to overwrite the state of a
+     * non-null destination resource during a COPY or MOVE. A Overwrite header
+     * value of 'F' will return false.
+     *
+     * @return true if the Overwrite header is set to 'T', false if it is set
+     * to 'F'.
+     * @see DavConstants#HEADER_OVERWRITE
+     */
+    public boolean isOverwrite();
+
+    /**
+     * Return the integer representation of the given {@link DavConstants#HEADER_DEPTH
+     * Depth header}. 'Infinity' is represented by {@link DavConstants#DEPTH_INFINITY}.
+     *
+     * @return integer representation of the {@link DavConstants#HEADER_DEPTH
+     * Depth header}.
+     * @see DavConstants#HEADER_DEPTH
+     */
+    public int getDepth();
+
+    /**
+     * Returns the integer representation of the {@link DavConstants#HEADER_DEPTH
+     * Depth header} or the given defaultValue, if the Depth header is missing.
+     *
+     * @param defaultValue to be returned if no Depth header is present.
+     * @return integer representation of the {@link DavConstants#HEADER_DEPTH
+     * Depth header} or the given defaultValue.
+     * @see DavConstants#HEADER_DEPTH
+     */
+    public int getDepth(int defaultValue);
+
+    /**
+     * Returns the token present in the {@link DavConstants#HEADER_LOCK_TOKEN
+     * Lock-Token Header} or <code>null</code> if no such header is available.<br>
+     * Note: The 'Lock-Token' header is sent with UNLOCK requests and with
+     * lock responses only. For any other request that may be affected by a lock
+     * the 'If' header field is responsible.
+     *
+     * @return the token present in the Lock-Token header.
+     * @see DavConstants#HEADER_LOCK_TOKEN
+     */
+    public String getLockToken();
+
+    /**
+     * Return the timeout requested in the {@link DavConstants#HEADER_TIMEOUT
+     * Timeout header} as <code>long</code>. The representation of the
+     * 'Infinite' timeout is left to the implementation.
+     *
+     * @return long value representation of the Timeout header.
+     * @see DavConstants#HEADER_TIMEOUT
+     * @see DavConstants#TIMEOUT_INFINITE
+     */
+    public long getTimeout();
+
+    /**
+     * Parse the Xml request body and return a {@link org.jdom.Document}.
+     * If the request body can not be parsed <code>null</code> is returned.
+     *
+     * @return Document representing the Xml request body or <code>null</code>.
+     */
+    public Document getRequestDocument();
+
+    /**
+     * Return the type of PROPFIND request as indicated by the PROPFIND request
+     * body.
+     *
+     * @return type of PROPFIND request
+     * @see DavConstants#PROPFIND_ALL_PROP
+     * @see DavConstants#PROPFIND_BY_PROPERTY
+     * @see DavConstants#PROPFIND_PROPERTY_NAMES
+     */
+    public int getPropFindType();
+
+    /**
+     * Return the set of properties the client requested with a PROPFIND request
+     * or an empty set if the type of PROPFIND request was {@link DavConstants#PROPFIND_ALL_PROP}
+     * or {@link DavConstants#PROPFIND_PROPERTY_NAMES}.
+     *
+     * @return set of properties the client requested with a PROPFIND request
+     */
+    public DavPropertyNameSet getPropFindProperties();
+
+    /**
+     * Return the set of properties the client wanted to modify / create with a
+     * PROPPATCH request, i.e. all entries in the &lt;propertyupdate&gt; element
+     * of the request body with name &lt;set&gt;.
+     *
+     * @return set of properties the client wanted to modify / create with a
+     * PROPPATCH request.
+     */
+    public DavPropertySet getPropPatchSetProperties();
+
+    /**
+     * Return the set of property names the client wanted to remove with a
+     * PROPPATCH request, i.e. all entries in the &lt;propertyupdate&gt; element
+     * of the request body with name &lt;remove&gt;.<br>
+     * Note, that in constrast to the &lt;set&gt; Xml element, all the XML
+     * elements in a prop XML element inside of a remove XML element must be
+     * empty, as only the names of properties to be removed are required. Therefore
+     * a <code>DavPropertyNameSet</code> is returned and not a <code>DavPropertySet</code>
+     *
+     * @return set of property names the client wanted to remove with a
+     * PROPPATCH request.
+     */
+    public DavPropertyNameSet getPropPatchRemoveProperties();
+
+    /**
+     * Return the parsed 'lockinfo' request body, the {@link DavConstants#HEADER_TIMEOUT
+     * Timeout header} and the {@link DavConstants#HEADER_DEPTH Depth header}
+     * of a LOCK request as <code>LockInfo</code> object.
+     *
+     * @return <code>LockInfo</code> object encapsulating the information
+     * present in the LOCK request.
+     * @see DavConstants#HEADER_TIMEOUT
+     * @see DavConstants#HEADER_DEPTH
+     * @see DavConstants#XML_LOCKINFO
+     */
+    public LockInfo getLockInfo();
+
+    /**
+     * Returns true, if the {@link DavConstants#HEADER_IF If header} present
+     * with the request matches the given resource.
+     *
+     * @param resource
+     * @return true, if the test is successful, false otherwise.
+     */
+    public boolean matchesIfHeader(DavResource resource);
+
+    /**
+     * Returns true, if the {@link DavConstants#HEADER_IF If header} present
+     * with the request matches to the given href, token and eTag.
+     *
+     * @param href
+     * @param token
+     * @param eTag
+     * @return true, if the test is successful, false otherwise.
+     */
+    public boolean matchesIfHeader(String href, String token, String eTag);
+}
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavServletRequest.java
------------------------------------------------------------------------------
    svn = 

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavServletRequest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavServletResponse.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavServletResponse.java?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavServletResponse.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavServletResponse.java Sun Mar  6 06:02:39 2005
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.webdav;
+
+import org.apache.jackrabbit.webdav.lock.ActiveLock;
+import org.jdom.Document;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * <code>WebdavResponse</code> extends the HttpServletResponse by
+ * Webdav specific status codes and METHODS.
+ */
+public interface DavServletResponse extends HttpServletResponse {
+
+    /**
+     * The 102 (Processing) status code is an interim response used to
+     * inform the client that the server has accepted the complete request,
+     * but has not yet completed it.
+     */
+    int SC_PROCESSING = 102;
+
+    /**
+     * Status code (207) indicating that the response requires
+     * providing status for multiple independent operations.
+     */
+    int SC_MULTI_STATUS = 207;
+
+    /**
+     * Status code (422) indicating the entity body submitted with
+     * the PATCH method was not understood by the resource.
+     */
+    int SC_UNPROCESSABLE_ENTITY = 422;
+
+    /**
+     * Status code (423) indicating the destination resource of a
+     * method is locked, and either the request did not contain a
+     * valid Lock-Info header, or the Lock-Info header identifies
+     * a lock held by another principal.
+     */
+    int SC_LOCKED = 423;
+
+    /**
+     * Status code (424) incidating that the method could not be
+     * performed on the resource, because the requested action depended
+     * on another action which failed.
+     */
+    int SC_FAILED_DEPENDENCY = 424;
+
+    /**
+     * Status code (507) indicating that the resource does not have
+     * sufficient space to record the state of the resource after the
+     * execution of this method.
+     */
+    int SC_INSUFFICIENT_SPACE_ON_RESOURCE = 507;
+
+    /**
+     * Send a response body given more detailed information about the error
+     * occured.
+     *
+     * @param error
+     * @throws IOException
+     */
+    public void sendErrorResponse(DavException error) throws IOException;
+
+    /**
+     * Send the multistatus response to the client. A multistatus response
+     * is returned in response to a successful PROPFIND and PROPPATCH request.
+     * In addition multistatus response is required response in case a COPY,
+     * MOVE, DELETE, LOCK or PROPPATCH request fails.
+     *
+     * @param multistatus
+     * @throws IOException
+     * @see #SC_MULTI_STATUS
+     */
+    public void sendMultiStatusResponse(MultiStatus multistatus) throws IOException;
+
+    /**
+     * Send the lock response for a successful LOCK request. The given <code>ActiveLock</code>
+     * object is included in the lockdiscovery property of the response
+     * body as required by RFC 2518.
+     *
+     * @param lock
+     * @throws IOException
+     * @see DavConstants#PROPERTY_LOCKDISCOVERY
+     */
+    public void sendLockResponse(ActiveLock lock) throws IOException;
+
+    /**
+     * Send the lock response for a successful LOCK request, that was intended
+     * to refresh an existing lock. The locks array must contain at least
+     * a single element; the <code>ActiveLock</code> objects are then
+     * included in the lockdiscovery property of the response body as required
+     * by RFC 2518.
+     *
+     * @param locks
+     * @throws IOException
+     * @see DavConstants#PROPERTY_LOCKDISCOVERY
+     */
+    public void sendRefreshLockResponse(ActiveLock[] locks) throws IOException;
+
+    /**
+     * Generic method to return an Xml response body.
+     *
+     * @param xmlDoc Xml document representing the response body.
+     * @param status Status code to be used with {@link #setStatus(int)}.
+     * @throws IOException
+     */
+    public void sendXmlResponse(Document xmlDoc, int status) throws IOException;
+}
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavServletResponse.java
------------------------------------------------------------------------------
    svn = 

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavServletResponse.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavSession.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavSession.java?view=auto&rev=156314
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavSession.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavSession.java Sun Mar  6 06:02:39 2005
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.webdav;
+
+import javax.jcr.Session;
+
+/**
+ * <code>DavSession</code> wraps a {@link Session repository session}
+ * object, that is obtained on
+ * {@link javax.jcr.Repository#login(javax.jcr.Credentials, String) login} to
+ * the underlaying repository.
+ */
+public interface DavSession {
+
+    /**
+     * Adds a reference to this <code>DavSession</code> indicating that
+     * the underlaying {@link Session} object is needed for actions spanning over
+     * multiple requests.
+     *
+     * @param reference to be added.
+     */
+    public void addReference(Object reference);
+
+    /**
+     * Releasing a reference to this <code>DavSession</code>. If no more
+     * references are present, the underlaying {@link Session} may be discarded
+     * (e.g by calling {@link Session#logout()}.
+     *
+     * @param reference to be removed.
+     */
+    public void removeReference(Object reference);
+
+    /**
+     * Unwrap the {@link Session repository session} object.
+     *
+     * @return the session object wrapped by this <code>DavSession</code>
+     */
+    public Session getRepositorySession();
+
+    /**
+     * Adds a lock token to this <code>DavSession</code>.
+     *
+     * @param token
+     */
+    public void addLockToken(String token);
+
+    /**
+     * Returns the lock tokens of this <code>DavSession</code>.
+     *
+     * @return
+     */
+    public String[] getLockTokens();
+
+    /**
+     * Removes a lock token from this <code>DavSession</code>.
+     *
+     * @param token
+     */
+    public void removeLockToken(String token);
+
+}
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavSession.java
------------------------------------------------------------------------------
    svn = 

Propchange: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavSession.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message