KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > dods > DODSException


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  */

19
20 /*
21  *
22  * @author Nenad Vico
23  * @version 1.0.0 2003/03/09
24  *
25  */

26 package org.enhydra.dods;
27
28 import org.enhydra.dods.exceptions.DodsBaseException;
29
30 public class DODSException extends DodsBaseException {
31     
32     
33
34     /**
35      * Construct a exception without a specified cause.
36      *
37      * @param msg The message associated with the exception.
38      */

39     public DODSException(String JavaDoc msg) {
40         super(msg);
41     }
42
43     /**
44      * Construct a exception with a specified cause.
45      *
46      * @param cause The error or exception that cause this
47      * exception.
48      */

49     public DODSException(Throwable JavaDoc cause) {
50         super(cause);
51     }
52
53     /**
54      * Construct a exception with an associated causing exception.
55      *
56      * @param msg The message associated with the exception.
57      * @param cause The error or exception that cause this
58      * exception.
59      */

60     public DODSException(String JavaDoc msg, Throwable JavaDoc cause) {
61         super(msg, cause);
62     }
63
64     /**
65      * Creates a localized description of this Exception.
66      *
67      * @return the localized description of this Exception.
68      */

69     public String JavaDoc getLocalizedMessage() {
70         String JavaDoc message = getMessage();
71         int index = message.lastIndexOf(": ");
72
73         if (index != -1) {
74             return message.substring(index + 1);
75         } else {
76             return getMessage();
77         }
78     }
79 }
80
Popular Tags