01: /*
02: * Base64 decoding exception.
03: * Copyright (C) 2002 Stephen Ostermiller
04: * http://ostermiller.org/contact.pl?regarding=Java+Utilities
05: *
06: * This program is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU General Public License as published by
08: * the Free Software Foundation; either version 2 of the License, or
09: * (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * See COPYING.TXT for details.
17: */
18: package com.Ostermiller.util;
19:
20: import java.io.*;
21:
22: /**
23: * Exception that is thrown when an unexpected character is encountered
24: * during Base64 decoding. One could catch this exception and use
25: * the unexpected character for some other purpose such as including it
26: * with data that comes at the end of a Base64 encoded section of an email
27: * message.
28: *
29: * @author Stephen Ostermiller http://ostermiller.org/contact.pl?regarding=Java+Utilities
30: * @since ostermillerutils 1.00.00
31: */
32: public class Base64DecodingException extends IOException {
33: /**
34: * Serial version ID
35: */
36: private static final long serialVersionUID = 2411555227634603928L;
37: private char c;
38:
39: /**
40: * Construct an new exception.
41: *
42: * @param message message later to be returned by a getMessage() call.
43: * @param c character that caused this error.
44: *
45: * @since ostermillerutils 1.00.00
46: */
47: public Base64DecodingException(String message, char c) {
48: super (message);
49: this .c = c;
50: }
51:
52: /**
53: * Get the character that caused this error.
54: *
55: * @return the character that caused this error.
56: *
57: * @since ostermillerutils 1.00.00
58: */
59: public char getChar() {
60: return c;
61: }
62: }
|