]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.cms/src/org/argeo/cms/dav/DavResponse.java
FS utils throws IOException
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / dav / DavResponse.java
1 package org.argeo.cms.dav;
2
3 import java.util.ArrayList;
4 import java.util.HashMap;
5 import java.util.List;
6 import java.util.Map;
7 import java.util.Set;
8 import java.util.TreeMap;
9 import java.util.TreeSet;
10
11 import javax.xml.namespace.QName;
12
13 import org.argeo.cms.http.HttpStatus;
14
15 /** The WebDav response for a given resource. */
16 public class DavResponse {
17 final static String MOD_DAV_NAMESPACE = "http://apache.org/dav/props/";
18
19 private String href;
20 private boolean collection;
21 private Map<HttpStatus, Set<QName>> propertyNames = new TreeMap<>();
22 private Map<QName, String> properties = new HashMap<>();
23 private List<QName> resourceTypes = new ArrayList<>();
24
25 public Map<QName, String> getProperties() {
26 return properties;
27 }
28
29 public void setHref(String href) {
30 this.href = href;
31 }
32
33 public String getHref() {
34 return href;
35 }
36
37 public boolean isCollection() {
38 return collection;
39 }
40
41 public void setCollection(boolean collection) {
42 this.collection = collection;
43 }
44
45 public List<QName> getResourceTypes() {
46 return resourceTypes;
47 }
48
49 public Set<QName> getPropertyNames(HttpStatus status) {
50 if (!propertyNames.containsKey(status))
51 propertyNames.put(status, new TreeSet<>(DavXmlElement.QNAME_COMPARATOR));
52 return propertyNames.get(status);
53 }
54
55 public Set<HttpStatus> getStatuses() {
56 return propertyNames.keySet();
57 }
58
59 }