KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Header: /home/cvs/jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/methods/UncheckoutMethod.java,v 1.4 2004/08/02 15:45:48 unico Exp $
3  * $Revision: 1.4 $
4  * $Date: 2004/08/02 15:45:48 $
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.HttpConnection;
29 import org.apache.commons.httpclient.HttpException;
30 import org.apache.commons.httpclient.HttpState;
31 import org.apache.webdav.lib.util.WebdavStatus;
32
33
34 /**
35  * The Checkout method can be applied to a checked-in version-controlled
36  * resource.
37  *
38  *
39  *
40  * <h3>Example Request</h3>
41  * <pre>
42  * Uncheckout /foo.html HTTP/1.1
43  * Host: www.server.org
44  * Content-Length: xx
45  * </pre>
46  *
47  * <h3>Example Response</h3>
48  * <pre>
49  * HTTP/1.1 200 OK
50  * </pre>
51  *
52  */

53 public class UncheckoutMethod
54     extends XMLResponseMethodBase {
55
56
57     // -------------------------------------------------------------- Constants
58

59
60
61     // ----------------------------------------------------- Instance Variables
62

63
64     // ----------------------------------------------------------- Constructors
65

66
67     /**
68      * Method constructor.
69      */

70     public UncheckoutMethod() {
71     }
72
73
74     /**
75      * Method constructor.
76      */

77     public UncheckoutMethod(String JavaDoc path) {
78         super(path);
79     }
80
81
82
83
84
85     // ------------------------------------------------------------- Properties
86

87     public String JavaDoc getName() {
88         return "UNCHECKOUT";
89     }
90
91     /**
92      * Parse response.
93      *
94      * @param input Input stream
95      */

96     public void parseResponse(InputStream JavaDoc input, HttpState state, HttpConnection conn)
97         throws IOException JavaDoc, HttpException {
98         try
99         {
100             int code = getStatusLine().getStatusCode();
101             if (code == WebdavStatus.SC_CONFLICT ||
102                 code == WebdavStatus.SC_FORBIDDEN ) {
103                 parseXMLResponse(input);
104             }
105         }
106         catch (IOException JavaDoc e) {
107                 // FIX ME: provide a way to deliver non xml data
108
}
109     }
110
111
112 }
113
Popular Tags