org.apache.jackrabbit.webdav.jcr
Class JcrDavException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.apache.jackrabbit.webdav.DavException
              extended by org.apache.jackrabbit.webdav.jcr.JcrDavException
All Implemented Interfaces:
Serializable, XmlSerializable

public class JcrDavException
extends DavException

JcrDavException extends the DavException in 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
JcrDavException(RepositoryException cause)
          Same as JcrDavException(Throwable, int) where the error code is retrieved from an internal mapping.
JcrDavException(Throwable cause, int errorCode)
          Create a new JcrDavException.
 
Method Summary
 boolean hasErrorCondition()
          Always returns true.
 Element toXml(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, getStatusPhrase, getStatusPhrase
 
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

JcrDavException

public JcrDavException(Throwable cause,
                       int errorCode)
Create a new JcrDavException.

Parameters:
cause - The original cause of this DavException. Note, that in contrast to Throwable.Throwable(Throwable), Throwable.Throwable(String, Throwable) and Throwable.initCause(Throwable) the cause must not be null.
errorCode - Status code for the response.
Throws:
NullPointerException - if the given exception is null.
See Also:
DavException.DavException(int, String), DavException.DavException(int)

JcrDavException

public JcrDavException(RepositoryException cause)
Same as JcrDavException(Throwable, int) where the error code is retrieved from an internal mapping.

Parameters:
cause - Cause of this DavException
Throws:
NullPointerException - if the given exception is null.
See Also:
JcrDavException(Throwable, int)
Method Detail

hasErrorCondition

public boolean hasErrorCondition()
Always returns true.

Overrides:
hasErrorCondition in class DavException
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:
toXml in interface XmlSerializable
Overrides:
toXml in class DavException
Parameters:
document -
Returns:
Xml representation of this exception.
See Also:
XmlSerializable.toXml(Document)


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.