org.apache.jackrabbit.webdav
Class DavException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byorg.apache.jackrabbit.webdav.DavException
All Implemented Interfaces:
Serializable

public class DavException
extends Exception

DavException extends the Exception class in order to simplify handling of exceptional situations occuring during processing of WebDAV requests and provides possibility to retrieve an Xml representation of the error.

See Also:
Serialized Form

Constructor Summary
DavException(int errorCode)
          Create a new DavException.
DavException(int errorCode, String message)
          Create a new DavException.
DavException(int errorCode, String message, org.jdom.Element conditionElement)
          Create a new DavException.
 
Method Summary
 org.jdom.Element getError()
          Returns the Xml representation of this DavException.
 int getErrorCode()
          Return the error code 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.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DavException

public DavException(int errorCode,
                    String message)
Create a new DavException.

Parameters:
errorCode - integer specifying any of the status codes defined by DavServletResponse.
message - Human readable error message.

DavException

public DavException(int errorCode)
Create a new DavException.

Parameters:
errorCode - integer specifying any of the status codes defined by DavServletResponse.

DavException

public DavException(int errorCode,
                    String message,
                    org.jdom.Element conditionElement)
Create a new DavException.

Parameters:
errorCode - integer specifying any of the status codes defined by DavServletResponse.
message -
conditionElement -
Method Detail

getErrorCode

public int getErrorCode()
Return the error code attached to this DavException.

Returns:
errorCode

getError

public org.jdom.Element getError()
Returns the Xml representation of this DavException. In case no Element has been passed to the constructor, an empty DAV:error element is returned.

Returns:
Xml representation of this exception.

getStatusPhrase

public String getStatusPhrase()
Return the status phrase corresponding to the error code attached to this DavException.

Returns:
status phrase corresponding to the error code.
See Also:
getErrorCode()

getStatusPhrase

public static String getStatusPhrase(int errorCode)
Returns the status phrase for the given error code.

Parameters:
errorCode -
Returns:
status phrase corresponding to the given error code.


Copyright © 2005 . All Rights Reserved.