List of utility methods to do IOException Create
IOException | toIOE(Exception e) to IOE return toIOE(e.getMessage(), e);
|
IOException | toIOException(Exception e) to IO Exception return e instanceof IOException ? (IOException) e : new IOException(e); |
IOException | toIOException(Exception e) to IO Exception if (e instanceof InterruptedException) { InterruptedIOException ioe = new InterruptedIOException(); ioe.initCause(e); return ioe; } else { return new IOException(e); |
IOException | toIOException(ExecutionException e) to IO Exception final Throwable cause = e.getCause(); return cause != null ? asIOException(cause) : new IOException(e); |
IOException | toIOException(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); |
IOException | toIOException(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; |
IOException | toIoException(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); |
IOException | toIOException(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); |
IOException | toIOException(Throwable e) to IO Exception if (e instanceof IOException) { return (IOException) e; } else { return new IOException(e.getMessage()); |
IOException | toIOException(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); ... |