code: public static IOException castToIOException(Throwable e) {
      if (e instanceof IOException) {
        return (IOException) e;
      } else {
        return new IOException(e);
      }
    }
docs: Casts a {@link Throwable} to an {@link IOException}.
  
  @param e the throwable
  @return the IO exception