Java Utililty Methods IOException Create

List of utility methods to do IOException Create

Description

The list of methods to do IOException Create are organized into topic(s).

Method

IOExceptiontoIOE(Exception e)
to IOE
return toIOE(e.getMessage(), e);
IOExceptiontoIOException(Exception e)
to IO Exception
return e instanceof IOException ? (IOException) e : new IOException(e);
IOExceptiontoIOException(Exception e)
to IO Exception
if (e instanceof InterruptedException) {
    InterruptedIOException ioe = new InterruptedIOException();
    ioe.initCause(e);
    return ioe;
} else {
    return new IOException(e);
IOExceptiontoIOException(ExecutionException e)
to IO Exception
final Throwable cause = e.getCause();
return cause != null ? asIOException(cause) : new IOException(e);
IOExceptiontoIOException(final Throwable e)
Creates an IOException from the Throwable if it isn't already an IOException
return (e instanceof IOException) ? (IOException) e : new IOException(e);
IOExceptiontoIOException(String msg, Throwable cause)
Jdk 1.6++ contains constructors with causes for IOException , but older jdk versions do not.
final IOException ex = new IOException(msg);
ex.initCause(cause);
return ex;
IOExceptiontoIoException(Throwable cause)
An utility method to wrap Throwable s in IOException s unless they are already an IOException in which case it will simply cast and return it.
if (cause == null) {
    throw new NullPointerException("cause");
if (cause instanceof IOException) {
    return (IOException) cause;
return new IOException(cause);
IOExceptiontoIOException(Throwable cause)
Convert a Throwable to an IOException .
if (cause instanceof IOException) {
    return (IOException) cause;
} else if (cause instanceof ExecutionException || cause instanceof CompletionException) {
    return toIOException(cause.getCause());
} else {
    return new IOException(cause);
IOExceptiontoIOException(Throwable e)
to IO Exception
if (e instanceof IOException) {
    return (IOException) e;
} else {
    return new IOException(e.getMessage());
IOExceptiontoIOException(Throwable inThrownException, boolean inCheckCauses)
to IO Exception
if (inThrownException == null) {
    return null;
if (inThrownException instanceof IOException) {
    return (IOException) inThrownException;
if (inCheckCauses) {
    final IOException ioe = findException(IOException.class, inThrownException);
...