|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
Options.java | 0% | 0% | 0% | 0% |
|
1 | /* | |
2 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
3 | * contributor license agreements. See the NOTICE file distributed with | |
4 | * this work for additional information regarding copyright ownership. | |
5 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
6 | * (the "License"); you may not use this file except in compliance with | |
7 | * the License. You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
15 | * limitations under the License. | |
16 | * | |
17 | * $Id: Options.java 551438 2007-06-28 04:09:44Z vgritsenko $ | |
18 | */ | |
19 | ||
20 | package org.apache.xindice.webadmin.webdav.components; | |
21 | ||
22 | import org.apache.xindice.webadmin.Location; | |
23 | import org.apache.xindice.webadmin.webdav.DAVRequest; | |
24 | import org.apache.xindice.webadmin.webdav.DAVResponse; | |
25 | ||
26 | import javax.servlet.ServletException; | |
27 | ||
28 | import java.io.IOException; | |
29 | ||
30 | /** | |
31 | * This class implements the Options command for WebDAV operations on | |
32 | * Xindice. | |
33 | * | |
34 | * @author <a href="mailto:jmetzner@apache.org">Jan Metzner</a> | |
35 | * @author <a href="mailto:gianugo@apache.org">Gianugo Rabellino</a> | |
36 | * @version $Revision: 551438 $, $Date: 2007-06-27 21:09:44 -0700 (Wed, 27 Jun 2007) $ | |
37 | */ | |
38 | public class Options implements DAVComponent { | |
39 | ||
40 | 0 | public void execute(DAVRequest req, DAVResponse res, Location target) throws ServletException, IOException { |
41 | // DAV Level 1 | |
42 | 0 | res.addHeader("DAV", "1"); |
43 | ||
44 | 0 | String methodsAllowed; |
45 | 0 | if (target.isRoot()) { |
46 | 0 | methodsAllowed = "OPTIONS, PROPFIND"; |
47 | 0 | } else if (target.getName() == null) { |
48 | 0 | methodsAllowed = "OPTIONS, POST, DELETE, PROPFIND, PROPPATCH, COPY, MOVE, PUT, MKCOL"; |
49 | } else { | |
50 | 0 | methodsAllowed = "OPTIONS, GET, HEAD, POST, DELETE, PROPFIND, PROPPATCH, COPY, MOVE"; |
51 | } | |
52 | ||
53 | 0 | res.addHeader("Allow", methodsAllowed); |
54 | ||
55 | // MS support | |
56 | 0 | res.addHeader("MS-Author-Via", "DAV"); |
57 | } | |
58 | } |
|