You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by re...@apache.org on 2008/09/29 14:48:24 UTC
svn commit: r700112 - in
/jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav:
bind/BindServletRequest.java client/methods/RebindMethod.java
Author: reschke
Date: Mon Sep 29 05:48:23 2008
New Revision: 700112
URL: http://svn.apache.org/viewvc?rev=700112&view=rev
Log:
JCR-1733: add files missing in revision 700097.
Added:
jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/bind/BindServletRequest.java
jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/RebindMethod.java
Added: jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/bind/BindServletRequest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/bind/BindServletRequest.java?rev=700112&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/bind/BindServletRequest.java (added)
+++ jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/bind/BindServletRequest.java Mon Sep 29 05:48:23 2008
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.bind;
+
+import org.apache.jackrabbit.webdav.DavException;
+import org.apache.jackrabbit.webdav.DavResourceLocator;
+
+/**
+ * <code>BindServletRequest</code> provides extension useful for functionality
+ * related to BIND specification.
+ */
+public interface BindServletRequest {
+
+ /**
+ * Returns the {@link RebindInfo} present with the request
+ *
+ * @return {@link RebindInfo} object
+ * @throws org.apache.jackrabbit.webdav.DavException in case of an invalid or missing request body
+ */
+ public RebindInfo getRebindInfo() throws DavException;
+
+ /**
+ * Returns the {@link UnbindInfo} present with the request
+ *
+ * @return {@link UnbindInfo} object
+ * @throws org.apache.jackrabbit.webdav.DavException in case of an invalid or missing request body
+ */
+ public UnbindInfo getUnbindInfo() throws DavException;
+
+ /**
+ * Returns the {@link BindInfo} present with the request
+ *
+ * @return {@link BindInfo} object
+ * @throws org.apache.jackrabbit.webdav.DavException in case of an invalid or missing request body
+ */
+ public BindInfo getBindInfo() throws DavException;
+
+ /**
+ * Parses a href and returns the path of the resource.
+ *
+ * @return path of the resource identified by the href.
+ */
+ public DavResourceLocator getHrefLocator(String href) throws DavException;
+
+ /**
+ * Returns the path of the member resource of the request resource which is identified by the segment parameter.
+ *
+ * @return path of internal member resource.
+ */
+ public DavResourceLocator getMemberLocator(String segment);
+}
Added: jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/RebindMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/RebindMethod.java?rev=700112&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/RebindMethod.java (added)
+++ jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/RebindMethod.java Mon Sep 29 05:48:23 2008
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.client.methods;
+
+import org.apache.jackrabbit.webdav.bind.RebindInfo;
+import org.apache.jackrabbit.webdav.DavServletResponse;
+
+import java.io.IOException;
+
+/**
+ * <code>RebindMethod</code> replaces a binding to a resource (atomic version of move).
+ */
+public class RebindMethod extends DavMethodBase {
+
+ public RebindMethod(String uri, RebindInfo info) throws IOException {
+ super(uri);
+ setRequestBody(info);
+ }
+
+ //---------------------------------------------------------< HttpMethod >---
+ /**
+ * @see org.apache.commons.httpclient.HttpMethod#getName()
+ */
+ public String getName() {
+ return "REBIND";
+ }
+
+ //------------------------------------------------------< DavMethodBase >---
+ /**
+ *
+ * @param statusCode
+ * @return true if status code is 200 (existing binding was overwritten) or 201 (new binding created).
+ */
+ protected boolean isSuccess(int statusCode) {
+ return statusCode == DavServletResponse.SC_CREATED || statusCode == DavServletResponse.SC_OK;
+ }
+}
+