KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > webdav > method > PostMethod


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PostMethod.java,v 1.13 2004/08/02 16:36:01 unico Exp $
3  * $Revision: 1.13 $
4  * $Date: 2004/08/02 16:36:01 $
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.slide.webdav.method;
25
26 import java.io.IOException JavaDoc;
27
28 import org.apache.slide.common.NamespaceAccessToken;
29 import org.apache.slide.webdav.WebdavException;
30 import org.apache.slide.webdav.WebdavServletConfig;
31 import org.apache.slide.webdav.util.WebdavStatus;
32
33 /**
34  * POST method.
35  *
36  */

37 public class PostMethod extends PutMethod {
38     
39     
40     // ----------------------------------------------------------- Constructors
41

42     
43     /**
44      * Constructor.
45      *
46      * @param token the token for accessing the namespace
47      * @param config configuration of the WebDAV servlet
48      */

49     public PostMethod(NamespaceAccessToken token, WebdavServletConfig config) {
50         super(token, config);
51     }
52     
53     
54     protected void executeRequest()
55         throws WebdavException, IOException JavaDoc {
56         
57         if (!isCollection(requestUri)) {
58             super.executeRequest();
59         }
60         else {
61             int statusCode = WebdavStatus.SC_CONFLICT;
62             sendError( statusCode, getClass().getName()+".mustNotBeCollection" );
63             throw new WebdavException( statusCode );
64         }
65
66     }
67     
68 }
69
Popular Tags