1
2
3
4
5
6
7
8
9
10
11
12
13 package org.abstracthorizon.danube.webdav.xml.dav.request.properties;
14
15 import org.abstracthorizon.danube.webdav.ResourceAdapter;
16 import org.abstracthorizon.danube.webdav.xml.XMLParserHandler;
17 import org.abstracthorizon.danube.webdav.xml.dav.response.properties.ResponseProperty;
18
19 import org.xml.sax.SAXException;
20
21
22
23
24
25
26 public class DisplayName extends RequestProperty {
27
28
29 protected String displayName;
30
31
32
33
34
35 public DisplayName(XMLParserHandler parent) {
36 super(parent);
37 }
38
39 @Override
40 public Object end(Object current, String tag, String value) throws SAXException {
41 displayName = value;
42 return super.end(current, tag, value);
43 }
44
45
46
47
48
49 public String getDisplayName() {
50 return displayName;
51 }
52
53
54
55
56
57
58
59
60 public ResponseProperty processResponse(ResourceAdapter adapter, Object resource) {
61 Object root = adapter.findParentResource(resource);
62 if ((root == null) || root.equals(resource)) {
63 return super.processResponse(adapter, resource);
64 } else {
65 return new org.abstracthorizon.danube.webdav.xml.dav.response.properties.DisplayName(adapter.getResourceName(resource));
66 }
67 }
68
69 @Override
70 public String toString() {
71 return "DisplayName[" + displayName + "]";
72 }
73 }