1 /***
2 * FilterListIOException.java
3 *
4 * Project: Dependency Tool
5 *
6 * WHEN WHO WHAT
7 * 06.06.2003 pko initial public release
8 * 22.01.2002 ctr modification
9 * 08.01.2002 ctr creation
10 *
11 * Copyright 2003 ELCA Informatique SA
12 * Av. de la Harpe 22-24, 1000 Lausanne 13, Switzerland
13 * www.elca.ch
14 *
15 * This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public License
17 * as published by the Free Software Foundation; either version 2.1 of
18 * the License, or (at your option) any later version.
19 *
20 * This library is distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
28 * USA
29 */
30
31 package ch.elca.dependency.exception;
32
33 /***
34 * Wraps the exceptions that could occur during the reading or writing of the
35 * filter list to/from the file.<br>
36 * Because there are many in some cases technical exceptions which do not tell
37 * very much to the user, all these exceptions are wrapped in the
38 * <code>FilterListIOException</code>.
39 *
40 * @author Christoph Trutmann
41 * @version 1.0-beta
42 */
43 public class FilterListIOException extends Exception {
44
45 /***
46 * Standard error message.
47 */
48 private String m_message = "The filter list cannot be read or written.";
49
50 /***
51 * Constructor - Calls the constructor of the supperclass with no arguments.
52 */
53 public FilterListIOException() {
54 super();
55 }
56
57 /***
58 * Constructor with a specific message string. Calls the corresponding
59 * constructor of the superclass.
60 *
61 * @param msg Message string specified by the user.
62 */
63 public FilterListIOException(String msg) {
64 super( msg );
65 }
66
67 /***
68 * Constructor with the wrapped exception as an argument.
69 *
70 * @param e A <code>Eception</code> that is wrapped by this class.
71 */
72 public FilterListIOException(Exception e) {
73 super ( e.getMessage() );
74 }
75
76 /***
77 * Gets the message of the wrapped class and displays it with the standard
78 * message of this exception.
79 *
80 * @return A message string composed of the standard message of this class
81 * plus the message of the wrapped <code>Exception</code>.
82 */
83 public String getMessage() {
84 if (super.getMessage() == null) {
85 return m_message;
86 } else {
87 return m_message +"\n"+ super.getMessage();
88 }
89 }
90 }
This page was automatically generated by Maven