KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > webdav > lib > methods > MkcolMethod


1 /*
2  * $Header: /home/cvs/jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/methods/MkcolMethod.java,v 1.3 2004/07/28 09:30:40 ib Exp $
3  * $Revision: 1.3 $
4  * $Date: 2004/07/28 09:30:40 $
5  *
6  * ====================================================================
7  *
8  * Copyright 1999-2002 The Apache Software Foundation
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */

23
24 package org.apache.webdav.lib.methods;
25
26 import java.io.IOException JavaDoc;
27 import java.io.InputStream JavaDoc;
28 import org.apache.commons.httpclient.HttpMethodBase;
29
30 /**
31  * The MKCOL method is used to create a new collection. All DAV compliant
32  * resources must support the MKCOL method. Collections are merely
33  * the HTTP name for structures like directories or folders (and, in
34  * fact, often map directly to a folder or directory on the web server.
35  *
36  * <p> This implementation of a MKCOL client method does not support a
37  * a request body, and the newly created web collection should therefore
38  * have no members.
39  *
40  * <p> MKCOL creates a new collection resource at the location specified by
41  * the Request-URI. If the resource identified by the Request-URI already
42  * exists on the server then the MKCOL will fail. During MKCOL processing,
43  * a server will make the Request-URI a member of the URI's parent collection
44  * (unless the Request-URI is "/"). If no parent collection exists, the method
45  * will fail. Thus, for example, if a request to create collection
46  * <code>/a/b/c/d/</code> is made, and neither <code>/a/b/</code> nor
47  * <code>/a/b/c/</code> exists, the request will fail.
48  *
49  * <p> MKCOL is not idempotent (that is to say, each MKCOL request should
50  * be handled by the web server, and the results of a MKCOL request should
51  * not be cached).
52  *
53  * <h3>Example Request</h3>
54  * <pre>
55  * MKCOL /webdisc/xfiles/ HTTP/1.1
56  * Host: www.server.org
57  * </pre>
58  *
59  * <h3>Example Response</h3>
60  * <pre>
61  * HTTP/1.1 201 Created
62  * </pre>
63  *
64  */

65 public class MkcolMethod
66     extends HttpMethodBase {
67
68
69     // ----------------------------------------------------------- Constructors
70

71
72     /**
73      * Method constructor.
74      */

75     public MkcolMethod() {
76     }
77
78
79     /**
80      * Method constructor.
81      */

82     public MkcolMethod(String JavaDoc path) {
83         super(path);
84     }
85
86
87     // --------------------------------------------------- WebdavMethod Methods
88

89
90     /**
91      * Parse the response body. The MKCOL method does not receive a response
92      * body.
93      *
94      * @param is Input stream
95      */

96     public void parseResponse(InputStream JavaDoc is)
97         throws IOException JavaDoc {
98     }
99
100     public String JavaDoc getName() {
101         return "MKCOL";
102     }
103
104
105 }
106
Popular Tags