1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.archive.io;
24
25 import java.io.IOException;
26 import java.io.PrintStream;
27 import java.io.PrintWriter;
28
29 /***
30 * A decorator on IOException for IOEs that are likely not fatal or at least
31 * merit retry.
32 * @author stack
33 * @version $Date: 2006-08-23 18:39:37 +0000 (Wed, 23 Aug 2006) $, $Revision: 4530 $
34 */
35 public class RecoverableIOException extends IOException {
36 private static final long serialVersionUID = 6194776587381865451L;
37 private final IOException decoratedIOException;
38
39 public RecoverableIOException(final String message) {
40 this(new IOException(message));
41 }
42
43 public RecoverableIOException(final IOException ioe) {
44 super();
45 this.decoratedIOException = ioe;
46 }
47
48 public Throwable getCause() {
49 return this.decoratedIOException.getCause();
50 }
51
52 public String getLocalizedMessage() {
53 return this.decoratedIOException.getLocalizedMessage();
54 }
55
56 public String getMessage() {
57 return this.decoratedIOException.getMessage();
58 }
59
60 public StackTraceElement[] getStackTrace() {
61 return this.decoratedIOException.getStackTrace();
62 }
63
64 public synchronized Throwable initCause(Throwable cause) {
65 return this.decoratedIOException.initCause(cause);
66 }
67
68 public void printStackTrace() {
69 this.decoratedIOException.printStackTrace();
70 }
71
72 public void printStackTrace(PrintStream s) {
73 this.decoratedIOException.printStackTrace(s);
74 }
75
76 public void printStackTrace(PrintWriter s) {
77 this.decoratedIOException.printStackTrace(s);
78 }
79
80 public void setStackTrace(StackTraceElement[] stackTrace) {
81 this.decoratedIOException.setStackTrace(stackTrace);
82 }
83
84 public String toString() {
85 return this.decoratedIOException.toString();
86 }
87 }