]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.cms/src/org/argeo/cms/dav/DavResponse.java
1 package org
.argeo
.cms
.dav
;
3 import java
.util
.ArrayList
;
4 import java
.util
.HashMap
;
8 import java
.util
.TreeMap
;
9 import java
.util
.TreeSet
;
11 import javax
.xml
.namespace
.QName
;
13 import org
.argeo
.cms
.http
.HttpStatus
;
15 /** The WebDav response for a given resource. */
16 public class DavResponse
{
17 final static String MOD_DAV_NAMESPACE
= "http://apache.org/dav/props/";
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
<>();
25 public Map
<QName
, String
> getProperties() {
29 public void setHref(String href
) {
33 public String
getHref() {
37 public boolean isCollection() {
41 public void setCollection(boolean collection
) {
42 this.collection
= collection
;
45 public List
<QName
> getResourceTypes() {
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
);
55 public Set
<HttpStatus
> getStatuses() {
56 return propertyNames
.keySet();