org.apache.jackrabbit.webdav.util
Class XmlUtil
java.lang.Object
org.apache.jackrabbit.webdav.util.XmlUtil
- All Implemented Interfaces:
- DavConstants
- public class XmlUtil
- extends Object
- implements DavConstants
XmlUtil
provides utility METHODS for building Xml representation.
Fields inherited from interface org.apache.jackrabbit.webdav.DavConstants |
creationDateFormat, DEPTH_0, DEPTH_1, DEPTH_INFINITY, DEPTH_INFINITY_S, HEADER_AUTHORIZATION, HEADER_CONTENT_LANGUAGE, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_DAV, HEADER_DEPTH, HEADER_DESTINATION, HEADER_ETAG, HEADER_IF, HEADER_LAST_MODIFIED, HEADER_LOCK_TOKEN, HEADER_OVERWRITE, HEADER_TIMEOUT, INFINITE_TIMEOUT, modificationDateFormat, NAMESPACE, NO_OVERWRITE, OPAQUE_LOCK_TOKEN_PREFIX, PROPERTY_CREATIONDATE, PROPERTY_DISPLAYNAME, PROPERTY_GETCONTENTLANGUAGE, PROPERTY_GETCONTENTLENGTH, PROPERTY_GETCONTENTTYPE, PROPERTY_GETETAG, PROPERTY_GETLASTMODIFIED, PROPERTY_LOCKDISCOVERY, PROPERTY_RESOURCETYPE, PROPERTY_SOURCE, PROPERTY_SUPPORTEDLOCK, PROPFIND_ALL_PROP, PROPFIND_BY_PROPERTY, PROPFIND_PROPERTY_NAMES, TIMEOUT_INFINITE, UNDEFINED_TIMEOUT, XML_ACTIVELOCK, XML_ALLPROP, XML_COLLECTION, XML_DEPTH, XML_DST, XML_EXCLUSIVE, XML_HREF, XML_KEEPALIVE, XML_LINK, XML_LOCKENTRY, XML_LOCKINFO, XML_LOCKSCOPE, XML_LOCKTOKEN, XML_LOCKTYPE, XML_MULTISTATUS, XML_OMIT, XML_OWNER, XML_PROP, XML_PROPERTYBEHAVIOR, XML_PROPERTYUPDATE, XML_PROPFIND, XML_PROPNAME, XML_PROPSTAT, XML_REMOVE, XML_RESPONSE, XML_RESPONSEDESCRIPTION, XML_SET, XML_SHARED, XML_SOURCE, XML_STATUS, XML_TIMEOUT, XML_WRITE |
Method Summary |
static org.jdom.Element |
depthToXml(boolean isDeep)
Returns the Xml representation of a boolean isDeep, where false
presents a depth value of '0', true a depth value of 'infinity'. |
static org.jdom.Element |
depthToXml(String depth)
Returns the Xml representation of a depth String. |
static String |
hrefFromXml(org.jdom.Element hrefElement)
Verifies that the given element is a DAV:href element, retrieves the
element text. |
static org.jdom.Element |
hrefToXml(String href)
Builds a 'DAV:href' Xml element from the given href. |
static org.jdom.Element |
timeoutToXml(long timeout)
Converts the given timeout (long value defining the number of milli-
second until timeout is reached) to its Xml representation as defined
by RTF 2518. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XmlUtil
public XmlUtil()
timeoutToXml
public static org.jdom.Element timeoutToXml(long timeout)
- Converts the given timeout (long value defining the number of milli-
second until timeout is reached) to its Xml representation as defined
by RTF 2518.
- Parameters:
timeout
- number of milli-seconds until timeout is reached.
- Returns:
- 'timeout' JDOM element
depthToXml
public static org.jdom.Element depthToXml(boolean isDeep)
- Returns the Xml representation of a boolean isDeep, where false
presents a depth value of '0', true a depth value of 'infinity'.
- Parameters:
isDeep
-
- Returns:
- Xml representation
depthToXml
public static org.jdom.Element depthToXml(String depth)
- Returns the Xml representation of a depth String. Webdav defines the
following valid values for depths: 0, 1, infinity
- Parameters:
depth
-
- Returns:
- 'deep' JDOM element
hrefToXml
public static org.jdom.Element hrefToXml(String href)
- Builds a 'DAV:href' Xml element from the given href. Please note, that
the path present in the given String should be properly
escaped
in order to prevent problems with
WebDAV clients.
- Parameters:
href
- String representing the text of the 'href' Xml element
- Returns:
- Xml representation of a 'href' according to RFC 2518.
hrefFromXml
public static String hrefFromXml(org.jdom.Element hrefElement)
- Verifies that the given element is a DAV:href element, retrieves the
element text.
- Parameters:
hrefElement
- a DAV:href element
- Returns:
- the URL decoded element text or empty String if the given element is empty.
Copyright © 2005 . All Rights Reserved.