View Javadoc

1   /* $Id: RecoverableIOException.java 4530 2006-08-23 18:39:37Z stack-sf $
2    *
3    * Created on August 21st, 2006
4    *
5    * Copyright (C) 2006 Internet Archive.
6    *
7    * This file is part of the Heritrix web crawler (crawler.archive.org).
8    *
9    * Heritrix is free software; you can redistribute it and/or modify
10   * it under the terms of the GNU Lesser Public License as published by
11   * the Free Software Foundation; either version 2.1 of the License, or
12   * any later version.
13   *
14   * Heritrix is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU Lesser Public License for more details.
18   *
19   * You should have received a copy of the GNU Lesser Public License
20   * along with Heritrix; if not, write to the Free Software
21   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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  }