KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ibm > webdav > WebDAVException


1 package com.ibm.webdav;
2
3 /*
4  * (C) Copyright IBM Corp. 2000 All rights reserved.
5  *
6  * The program is provided "AS IS" without any warranty express or
7  * implied, including the warranty of non-infringement and the implied
8  * warranties of merchantibility and fitness for a particular purpose.
9  * IBM will not be liable for any damages suffered by you as a result
10  * of using the Program. In no event will IBM be liable for any
11  * special, indirect or consequential damages or lost profits even if
12  * IBM has been advised of the possibility of their occurrence. IBM
13  * will not be liable for any third party claims against you.
14  */

15
16  /** This is the superclass of all WebDAV exceptions. It contains a status
17  * code that provides information, and a descriptive message.
18  * @author Jim Amsden <jamsden@us.ibm.com>
19  */

20 public class WebDAVException extends java.rmi.RemoteException JavaDoc
21 {
22    private int statusCode = 0;
23 /** Construct a WebDAVException
24 * @param statusCode the HTTP/1.1 or WebDAV status code
25 * @param statusMessage a message describing the exception of status code
26 */

27 public WebDAVException(int statusCode, String JavaDoc statusMessage) {
28     super(statusMessage);
29     this.statusCode = statusCode;
30 }
31 /** Get the status code that provides additional information about the
32 * exception. These status codes are defined by the HTTP/1.1 and WebDAV
33 * specifications.
34 * @return the HTTP/1.1 or WebDAV status code
35 * @see com.ibm.webdav.WebDAVStatus
36 */

37 public int getStatusCode() {
38     return statusCode;
39 }
40 /** Render this WebDAVException as a string including its status code.
41 * @return the string includes the status code and message
42 */

43 public String JavaDoc toString() {
44     return (new Integer JavaDoc(statusCode)).toString() + ": " + getMessage();
45 }
46 }
47
Popular Tags