|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
DisplayName.java | - | 75% | 75% | 75% |
|
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 | ||
18 | package org.apache.xindice.webadmin.webdav.components.props; | |
19 | ||
20 | import org.apache.xindice.core.Collection; | |
21 | import org.apache.xindice.core.data.Entry; | |
22 | import org.apache.xindice.webadmin.PartialResponse; | |
23 | ||
24 | /** | |
25 | * DisplayName creates a response node that contains resource name, which is | |
26 | * a collection name for collections and key for collection entries. | |
27 | * <br/><br/> | |
28 | * Example: | |
29 | * <pre> | |
30 | * <displayname> | |
31 | * System | |
32 | * </displayname> | |
33 | * </pre> | |
34 | * | |
35 | * @version $Revision: 636176 $, $Date: 2008-03-12 02:06:22 +0000 (Wed, 12 Mar 2008) $ | |
36 | */ | |
37 | public class DisplayName implements DAVProperty { | |
38 | private static final String DISPLAY_NAME = "displayname"; | |
39 | ||
40 | 2 | public String getName() { |
41 | 2 | return DISPLAY_NAME; |
42 | } | |
43 | ||
44 | 0 | public PartialResponse.Content getRootProperty() { |
45 | 0 | return new PartialResponse.Content(DISPLAY_NAME, "/"); |
46 | } | |
47 | ||
48 | 7 | public PartialResponse.Content getProperty(Collection col) { |
49 | 7 | return new PartialResponse.Content(DISPLAY_NAME, col.getName()); |
50 | } | |
51 | ||
52 | 5 | public PartialResponse.Content getProperty(Entry entry) { |
53 | 5 | return new PartialResponse.Content(DISPLAY_NAME, entry.getKey().toString()); |
54 | } | |
55 | ||
56 | } |
|