public class DavException extends Exception implements 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.Constructor and Description |
---|
DavException(int errorCode)
Create a new
DavException . |
DavException(int errorCode,
String message)
Create a new
DavException . |
DavException(int errorCode,
String message,
Throwable cause,
Element errorCondition)
Create a new
DavException . |
DavException(int errorCode,
Throwable cause)
Create a new
DavException . |
Modifier and Type | Method and Description |
---|---|
int |
getErrorCode()
Return the error code attached to this
DavException . |
Element |
getErrorCondition()
Return the error condition attached to this
DavException . |
String |
getStatusPhrase()
Return the status phrase corresponding to the error code attached to
this
DavException . |
static String |
getStatusPhrase(int errorCode)
Returns the status phrase for the given error code.
|
boolean |
hasErrorCondition() |
Element |
toXml(Document document)
Returns a DAV:error element containing the error condition or
null if no specific condition is available. |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public static final String XML_ERROR
public DavException(int errorCode, String message)
DavException
.errorCode
- integer specifying any of the status codes defined by
DavServletResponse
.message
- Human readable error message.DavException(int, String, Throwable, Element)
public DavException(int errorCode, Throwable cause)
DavException
.errorCode
- integer specifying any of the status codes defined by
DavServletResponse
.cause
- Cause of this DavExceptionDavException(int, String, Throwable, Element)
public DavException(int errorCode)
DavException
.errorCode
- integer specifying any of the status codes defined by
DavServletResponse
.DavException(int, String, Throwable, Element)
public DavException(int errorCode, String message, Throwable cause, Element errorCondition)
DavException
.errorCode
- integer specifying any of the status codes defined by
DavServletResponse
.message
- Human readable error message.cause
- Cause of this DavException
.errorCondition
- Xml element providing detailed information about
the error. If the condition is not null
, toXml(Document)
public int getErrorCode()
DavException
.public String getStatusPhrase()
DavException
.getErrorCode()
public static String getStatusPhrase(int errorCode)
errorCode
- public boolean hasErrorCondition()
public Element getErrorCondition()
DavException
.public Element toXml(Document document)
null
if no specific condition is available. See
RFC 3253
Section 1.6 "Method Preconditions and Postconditions" for additional
information.toXml
in interface XmlSerializable
document
- null
.XmlSerializable.toXml(Document)
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.