Package org.apache.jackrabbit.webdav.jcr
Class JcrDavException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.apache.jackrabbit.webdav.DavException
-
- org.apache.jackrabbit.webdav.jcr.JcrDavException
-
- All Implemented Interfaces:
Serializable,XmlSerializable
public class JcrDavException extends DavException
JcrDavExceptionextends theDavExceptionin order to wrap various repository exceptions.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.webdav.DavException
XML_ERROR
-
-
Constructor Summary
Constructors Constructor Description JcrDavException(Throwable cause, int errorCode)Create a newJcrDavException.JcrDavException(RepositoryException cause)Same asJcrDavException(Throwable, int)where the error code is retrieved from an internal mapping.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasErrorCondition()Always returns true.ElementtoXml(Document document)Returns a DAV:error Xml element containing the exceptions class and the message as child elements.-
Methods inherited from class org.apache.jackrabbit.webdav.DavException
getErrorCode, getErrorCondition, getStatusPhrase, getStatusPhrase
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
JcrDavException
public JcrDavException(Throwable cause, int errorCode)
Create a newJcrDavException.- Parameters:
cause- The original cause of thisDavException. Note, that in contrast toThrowable(Throwable),Throwable(String, Throwable)andThrowable.initCause(Throwable)the cause must not benull.errorCode- Status code for the response.- Throws:
NullPointerException- if the given exception isnull.- See Also:
DavException(int, String),DavException(int)
-
JcrDavException
public JcrDavException(RepositoryException cause)
Same asJcrDavException(Throwable, int)where the error code is retrieved from an internal mapping.- Parameters:
cause- Cause of this DavException- Throws:
NullPointerException- if the given exception isnull.- See Also:
JcrDavException(Throwable, int)
-
-
Method Detail
-
hasErrorCondition
public boolean hasErrorCondition()
Always returns true.- Overrides:
hasErrorConditionin classDavException- Returns:
- true
-
toXml
public Element toXml(Document document)
Returns a DAV:error Xml element containing the exceptions class and the message as child elements.- Specified by:
toXmlin interfaceXmlSerializable- Overrides:
toXmlin classDavException- Parameters:
document-- Returns:
- Xml representation of this exception.
- See Also:
XmlSerializable.toXml(Document)
-
-