1
2
3
4
5
6
7
8
9
10
11
12
13 package org.abstracthorizon.danube.webdav.xml.dav.response;
14
15 import org.abstracthorizon.danube.http.Status;
16 import org.abstracthorizon.danube.webdav.util.NamespacesProvider;
17 import org.abstracthorizon.danube.webdav.xml.XMLRenderer;
18 import org.abstracthorizon.danube.webdav.xml.common.XMLUtils;
19 import org.abstracthorizon.danube.webdav.xml.dav.DAVNamespace;
20
21 import java.io.PrintWriter;
22
23
24
25
26
27
28 public class Propstat implements XMLRenderer {
29
30
31 public static final String TAG_NAME = "propstat";
32
33
34 protected Response response;
35
36
37 protected ResponseProp prop = new ResponseProp();
38
39
40 protected Status status;
41
42
43 protected ResponseDescription responsedescription;
44
45
46
47
48
49 public Propstat(Response response) {
50 this.response = response;
51 }
52
53
54
55
56
57 public ResponseProp getProp() {
58 return prop;
59 }
60
61
62
63
64
65 public ResponseDescription getResponsedescription() {
66 return responsedescription;
67 }
68
69
70
71
72
73 public void setResponsedescription(ResponseDescription responsedescription) {
74 this.responsedescription = responsedescription;
75 }
76
77
78
79
80
81 public Status getStatus() {
82 return status;
83 }
84
85
86
87
88
89 public void setStatus(Status status) {
90 this.status = status;
91 }
92
93
94
95
96
97
98 public void render(PrintWriter writer, NamespacesProvider provider) {
99 writer.println(XMLUtils.createStartTag(provider, DAVNamespace.DAV_NAMESPACE_URL, TAG_NAME));
100 prop.render(writer, provider);
101 response.renderStatus(writer, provider, status);
102 if (responsedescription != null) {
103 responsedescription.render(writer, provider);
104 }
105 writer.println(XMLUtils.createEndTag(provider, DAVNamespace.DAV_NAMESPACE_URL, TAG_NAME));
106 }
107 }