|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.webdav.dom.ElementEditor
org.eclipse.webdav.dom.ResponseBody
public class ResponseBody
An element editor for the WebDAV response element. See RFC2518 section 12.9.1 for the element's definition.
Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
MultiStatus
,
PropStat
Field Summary | |
---|---|
protected static String[] |
childNames
An ordered collection of the element names of the responsebody element's children. |
static String[] |
fgNamesPropStat
An ordered collection of the element names of the responsebody element's children in the "propstat" form. |
static String[] |
fgNamesStatus
An ordered collection of the element names of the responsebody element's children in the "status" form. |
Fields inherited from class org.eclipse.webdav.dom.ElementEditor |
---|
DAV_NS, root, XML_NS_NAME, XML_NS_PREFIX, XML_PREFIX |
Constructor Summary | |
---|---|
ResponseBody(Element root)
Creates a new editor on the given WebDAV response element. |
Method Summary | |
---|---|
PropStat |
accumulatePropStat(Element element,
String status,
String responseDescription)
Gets this response's first propstat with the given status and adds a clone of the given element as a property of its prop. |
PropStat |
accumulatePropStat(QualifiedName propertyName,
String status,
String responseDescription)
Gets this response's first propstat with the given status and adds an element created from the given property name as a property of the propstat's prop. |
void |
addHref(String href)
Adds the given href to this response. |
PropStat |
addPropStat()
Creates and adds a propstat element on this response and returns an editor on it. |
void |
changePropStatStatus(String oldStatus,
String newStatus,
String responseDescription)
Changes all of this response's propstats with the given old status to have the given new status. |
static ResponseBody |
create(Document document)
Creates a new WebDAV response element and sets it as the root of the given document. |
String |
getHref()
Returns this response's first href. |
Enumeration |
getHrefs()
Returns an Enumeration of this response's hrefs (not
including the first href). |
Enumeration |
getPropStats()
Returns an Enumeration of this response's
Propstat s. |
String |
getResponseDescription()
Returns this response's response description, or null if
it has none. |
String |
getStatus()
Returns this response's status. |
int |
getStatusCode()
Returns this response's status code. |
boolean |
isPropStat()
Returns true if this response is in "propstat" form and
false if it is in "status" form. |
boolean |
isStatus()
Returns true if this response is in "status" form and
false if it is in "propstat" form. |
void |
setHref(String href)
Sets this response's first href to the given href. |
void |
setResponseDescription(Element value)
Sets this response's response description to the given value. |
void |
setResponseDescription(String value)
Sets this response's response description to the given value. |
void |
setStatus(String status)
Sets the status on this response to the given status. |
Methods inherited from class org.eclipse.webdav.dom.ElementEditor |
---|
addChild, addChild, addChild, appendChild, appendChild, cloneNode, create, declareNS, decodeHref, encodeHref, ensure, ensure, ensureDAVElement, ensureDAVElement, ensureNotNull, ensureNull, ensureText, extractElement, extractNode, getChild, getChildElement, getChildText, getDAVChild, getElement, getFirstChild, getFirstChild, getFirstText, getLastChild, getNamespaces, getNamespaces, getNextSibling, getNextSibling, getNextSibling, getNSLocalName, getNSLocalName, getNSName, getNSPrefix, getNSPrefix, getQualifiedName, getSibling, getText, getTwin, hasChild, insertBefore, insertBefore, isDAVElement, isDAVElement, isElement, isText, makeNSStandalone, reduceNS, reduceNS, resolve, setChild, setChild, setChild |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String[] childNames
public static String[] fgNamesStatus
public static String[] fgNamesPropStat
Constructor Detail |
---|
public ResponseBody(Element root) throws MalformedElementException
root
- a response element
MalformedElementException
- if there is reason to
believe that the element is not well formedMethod Detail |
---|
public PropStat accumulatePropStat(QualifiedName propertyName, String status, String responseDescription)
null
. Returns the propstat. The property name must not
be null
and its qualifier and local part must not be
null
and must not be the empty string. The status must
not be null
. This response must not already be in the
"status" form.
propertyName
- the name of the property to create and addstatus
- the status of the propstat to add the
property element toresponseDescription
- the new response description of the
propstat, or null
to remove
the old one
public PropStat accumulatePropStat(Element element, String status, String responseDescription) throws MalformedElementException
null
. Returns the propstat.
The element and status must not be null
. This response
must not already be in the "status" form.
element
- the property element being addedstatus
- the status of the propstat to add the
property element toresponseDescription
- the new response description of the
propstat, or null
to remove
the old one
MalformedElementException
- if there is
reason to believe that the given element
is not well formedpublic void addHref(String href)
setHref(String)
hasn't been called and no hrefs have been added, this method sets
the first href and is thus equivalent to
setHref(String)
. The href must not be null
.
This response must not already be in "propstat" form.
href
- the href to addpublic PropStat addPropStat()
public void changePropStatStatus(String oldStatus, String newStatus, String responseDescription)
null
. The
old status and new status must not be null. This
response must not be in the "status" form.
- Parameters:
oldStatus
- the old status of the propstat's that are
changednewStatus
- the new status of the propstat's that are
changedresponseDescription
- the new response description of the
propstat's that are changed, or
null
public static ResponseBody create(Document document)
null
, and must not already have a
root element.
document
- the document that will become the root of a new
response element
public String getHref() throws MalformedElementException
MalformedElementException
- if there is reason to believe that
this editor's underlying element is not well formedpublic Enumeration getHrefs() throws MalformedElementException
Enumeration
of this response's hrefs (not
including the first href).
Enumeration
of this response's href
Strings
- Throws:
MalformedElementException
- if there is reason to believe that
this editor's underlying element is not well formed, or if
this response is not in "status" form
public Enumeration getPropStats() throws MalformedElementException
Enumeration
of this response's
Propstat
s.
Enumeration
of this response's
PropStat
s
MalformedElementException
- if there is reason to believe that
this editor's underlying element is not well formed, or if
this response is not in "propstat" formpublic String getResponseDescription() throws MalformedElementException
null
if
it has none.
null
MalformedElementException
- if there is reason to believe that
this editor's underlying element is not well formedpublic String getStatus() throws MalformedElementException
MalformedElementException
- if there is reason to believe that
this editor's underlying element is not well formed, or if
this response is not in "status" formpublic int getStatusCode() throws MalformedElementException
MalformedElementException
- if there is reason to believe that
this editor's underlying element is not well formed, or if
this response is not in "status" formpublic boolean isPropStat() throws MalformedElementException
true
if this response is in "propstat" form and
false
if it is in "status" form.
MalformedElementException
- if there is reason to believe that
this editor's underlying element is not well formedpublic boolean isStatus() throws MalformedElementException
true
if this response is in "status" form and
false
if it is in "propstat" form.
MalformedElementException
- if there is reason to believe that
this editor's underlying element is not well formedpublic void setHref(String href)
null
.
href
- the href to set this response's first href topublic void setResponseDescription(String value)
null
and a response description has already
been set, it is removed.
value
- a response description, or null
public void setResponseDescription(Element value)
null
and a response description has already
been set, it is removed.
value
- a response description, or null
public void setStatus(String status)
null
. This response must not already be in
the "propstat" form.
status
- the status for this response
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |