java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.jackrabbit.webdav.DavException
- All Implemented Interfaces:
Serializable
,XmlSerializable
DavException
extends the Exception
class in order
to simplify handling of exceptional situations occurring during processing
of WebDAV requests and provides possibility to retrieve an Xml representation
of the error.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDavException
(int errorCode) Create a newDavException
.DavException
(int errorCode, String message) Create a newDavException
.DavException
(int errorCode, String message, Throwable cause, Element errorCondition) Create a newDavException
.DavException
(int errorCode, Throwable cause) Create a newDavException
. -
Method Summary
Modifier and TypeMethodDescriptionint
Return the error code attached to thisDavException
.Return the error condition attached to thisDavException
.Return the status phrase corresponding to the error code attached to thisDavException
.static String
getStatusPhrase
(int errorCode) Returns the status phrase for the given error code.boolean
Returns a DAV:error element containing the error condition ornull
if no specific condition is available.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
XML_ERROR
- See Also:
-
-
Constructor Details
-
DavException
Create a newDavException
.- Parameters:
errorCode
- integer specifying any of the status codes defined byDavServletResponse
.message
- Human readable error message.- See Also:
-
DavException
Create a newDavException
.- Parameters:
errorCode
- integer specifying any of the status codes defined byDavServletResponse
.cause
- Cause of this DavException- See Also:
-
DavException
public DavException(int errorCode) Create a newDavException
.- Parameters:
errorCode
- integer specifying any of the status codes defined byDavServletResponse
.- See Also:
-
DavException
Create a newDavException
.- Parameters:
errorCode
- integer specifying any of the status codes defined byDavServletResponse
.message
- Human readable error message.cause
- Cause of thisDavException
.errorCondition
- Xml element providing detailed information about the error. If the condition is notnull
,toXml(Document)
-
-
Method Details
-
getErrorCode
public int getErrorCode()Return the error code attached to thisDavException
.- Returns:
- errorCode
-
getStatusPhrase
Return the status phrase corresponding to the error code attached to thisDavException
.- Returns:
- status phrase corresponding to the error code.
- See Also:
-
getStatusPhrase
Returns the status phrase for the given error code.- Parameters:
errorCode
-- Returns:
- status phrase corresponding to the given error code.
-
hasErrorCondition
public boolean hasErrorCondition()- Returns:
- true if a error condition has been specified, false otherwise.
-
getErrorCondition
Return the error condition attached to thisDavException
.- Returns:
- errorCondition
-
toXml
Returns a DAV:error element containing the error condition ornull
if no specific condition is available. See RFC 3253 Section 1.6 "Method Preconditions and Postconditions" for additional information.- Specified by:
toXml
in interfaceXmlSerializable
- Parameters:
document
-- Returns:
- A DAV:error element indicating the error cause or
null
. - See Also:
-