org.apache.wink.webdav.model
Class Response

java.lang.Object
  extended by org.apache.wink.webdav.model.Response

public class Response
extends java.lang.Object

The response XML element per the WebDAV specification [RFC 4918]

    Name:       response
    Namespace:  DAV:
    Purpose:    Holds a single response describing the effect of a
    method on resource and/or its properties.
    Description: A particular href MUST NOT appear more than once as the
    child of a response XML element under a multistatus XML element.
    This requirement is necessary in order to keep processing costs for a
    response to linear time.  Essentially, this prevents having to search
    in order to group together all the responses by href.  There are,
    however, no requirements regarding ordering based on href values.
 
    <!ELEMENT response (href, ((href*, status)|(propstat+)),
    responsedescription?) >
 


Field Summary
protected  Error error
           
protected  java.util.List<java.lang.String> href
           
protected  java.util.List<Propstat> propstat
           
protected  java.lang.String responsedescription
           
protected  java.lang.String status
           
 
Constructor Summary
Response()
           
Response(java.lang.String href)
           
 
Method Summary
 Error getError()
          Gets the value of the error property.
 java.util.List<java.lang.String> getHref()
          Gets the value of the href property.
 Propstat getOrCreatePropstat(int status, java.lang.String description, Error error)
          Get a Propstat instance contained within this response that has the provided criteria, or create a new Propstat instance with the provided information if no propstat already exists.
 java.util.List<Propstat> getPropstat()
          Gets the value of the propstat property.
 Propstat getPropstat(int status, java.lang.String description, Error error)
          Get a Propstat instance contained within this response that has the provided criteria.
 java.lang.String getResponsedescription()
          Gets the value of the responsedescription property.
 java.lang.String getStatus()
          Gets the value of the status property.
 void setError(Error value)
          Sets the value of the error property.
 void setProperty(java.lang.Object property, int status)
          Add the provided property to the correct propstat element with the specified Http status.
 void setProperty(java.lang.Object property, int status, java.lang.String description, Error error)
          Sets the provided property to the correct propstat element.
 void setPropertyNotFound(java.lang.Object property)
          Add the provided property to the correct propstat element with an Http status of NOT FOUND.
 void setPropertyOk(java.lang.Object property)
          Add the provided property to the correct propstat element with an Http status of OK.
 void setResponsedescription(java.lang.String value)
          Sets the value of the responsedescription property.
 void setStatus(java.lang.String value)
          Sets the value of the status property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

href

protected java.util.List<java.lang.String> href

status

protected java.lang.String status

propstat

protected java.util.List<Propstat> propstat

error

protected Error error

responsedescription

protected java.lang.String responsedescription
Constructor Detail

Response

public Response()

Response

public Response(java.lang.String href)
Method Detail

getHref

public java.util.List<java.lang.String> getHref()
Gets the value of the href property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the href property.

For example, to add a new item, do as follows:

 getHref().add(newItem);
 

Objects of the following type(s) are allowed in the list String


getStatus

public java.lang.String getStatus()
Gets the value of the status property.

Returns:
possible object is String

setStatus

public void setStatus(java.lang.String value)
Sets the value of the status property.

Parameters:
value - allowed object is String

getPropstat

public java.util.List<Propstat> getPropstat()
Gets the value of the propstat property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the propstat property.

For example, to add a new item, do as follows:

 getPropstat().add(newItem);
 

Objects of the following type(s) are allowed in the list Propstat


getPropstat

public Propstat getPropstat(int status,
                            java.lang.String description,
                            Error error)
Get a Propstat instance contained within this response that has the provided criteria.

Parameters:
status - the Http status code of the propstat to retrieve
description - the description of the propstat to retrieve
error - the error of the propstat to retrieve. Note that when searching for a matching propstat, errors are considered the same only if both errors are null.
Returns:
the Propstat instance if a match is found, or null if no propstats matches all criteria

getOrCreatePropstat

public Propstat getOrCreatePropstat(int status,
                                    java.lang.String description,
                                    Error error)
Get a Propstat instance contained within this response that has the provided criteria, or create a new Propstat instance with the provided information if no propstat already exists.

Parameters:
status - the Http status code of the propstat to retrieve
description - the description of the propstat to retrieve
error - the error of the propstat to retrieve. Note that when searching for a matching propstat, errors are considered the same only if both errors are null.
Returns:

getError

public Error getError()
Gets the value of the error property.

Returns:
possible object is Error

setError

public void setError(Error value)
Sets the value of the error property.

Parameters:
value - allowed object is Error

getResponsedescription

public java.lang.String getResponsedescription()
Gets the value of the responsedescription property.

Returns:
possible object is String

setResponsedescription

public void setResponsedescription(java.lang.String value)
Sets the value of the responsedescription property.

Parameters:
value - allowed object is String

setPropertyOk

public void setPropertyOk(java.lang.Object property)
Add the provided property to the correct propstat element with an Http status of OK.

See Also:
#setProperty(Object, int, String, Error)}

setPropertyNotFound

public void setPropertyNotFound(java.lang.Object property)
Add the provided property to the correct propstat element with an Http status of NOT FOUND.

See Also:
#setProperty(Object, int, String, Error)}

setProperty

public void setProperty(java.lang.Object property,
                        int status)
Add the provided property to the correct propstat element with the specified Http status.

See Also:
#setProperty(Object, int, String, Error)}

setProperty

public void setProperty(java.lang.Object property,
                        int status,
                        java.lang.String description,
                        Error error)
Sets the provided property to the correct propstat element. The correct propstat element is selected according to the provided status, description and error parameters.

The following table details the possible Java types of every property (note that the DAV namespace depicts the WebDAV namespace "DAV:")

DAV:creationdate org.apache.wink.webdav.model.Creationdate
DAV:displayname org.apache.wink.webdav.model.Displayname
DAV:getcontentlanguage org.apache.wink.webdav.model.Getcontentlanguage
DAV:getcontentlength org.apache.wink.webdav.model.Getcontentlength
DAV:getcontenttype org.apache.wink.webdav.model.Getcontenttype
DAV:getetag org.apache.wink.webdav.model.Getetag
DAV:getlastmodified org.apache.wink.webdav.model.Getlastmodified
DAV:lockdiscovery org.apache.wink.webdav.model.Lockdiscovery
DAV:resourcetype org.apache.wink.webdav.model.Resourcetype
DAV:supportedlock org.apache.wink.webdav.model.Supportedlock
any other org.w3c.dom.Element

for example, if the property to set is DAV:getcontentlanguage then the property should be an instance of org.apache.wink.webdav.model.Getcontentlanguage.

if the property is K:myprop then the property should be an instance of org.w3c.dom.Element

Parameters:
property - the property to add
status - the status of the property to add
description - the description of the property
error - the error of the property


Copyright © 2009 The Apache Software Foundation. All Rights Reserved.