1
2
3
4
5
6
7
8
9
10
11
12
13 package org.abstracthorizon.danube.webdav.xml.dav.response.properties;
14
15 import org.abstracthorizon.danube.http.Status;
16 import org.abstracthorizon.danube.webdav.util.NamespacesProvider;
17 import org.abstracthorizon.danube.webdav.xml.common.XMLUtils;
18 import org.abstracthorizon.danube.webdav.xml.dav.DAVNamespace;
19
20 import java.io.PrintWriter;
21
22
23
24
25
26
27 public class GetContentLanguage extends ResponseProperty {
28
29
30 public static final String TAG_NAME = "getcontentlanguage";
31
32
33 protected String contentLanguage;
34
35
36
37
38
39 public GetContentLanguage(Status status) {
40 super(status);
41 }
42
43
44
45
46
47 public GetContentLanguage(String contentLanguage) {
48 this.contentLanguage = contentLanguage;
49 }
50
51
52
53
54
55 public String getContentLanguage() {
56 return contentLanguage;
57 }
58
59 @Override
60 public String toString() {
61 return "GetContentLanguage[" + contentLanguage + "]";
62 }
63
64
65
66
67
68
69 public void render(PrintWriter writer, NamespacesProvider provider) {
70 if ((contentLanguage == null) || (contentLanguage.length() == 0)) {
71 writer.println(XMLUtils.createEmptyTag(provider, DAVNamespace.DAV_NAMESPACE_URL, TAG_NAME));
72 } else {
73 writer.println(XMLUtils.createTag(provider, DAVNamespace.DAV_NAMESPACE_URL, TAG_NAME, contentLanguage));
74 }
75 }
76
77 }