Here you can find the source of toIOException(Exception e)
public static IOException toIOException(Exception e)
//package com.java2s; //License from project: Open Source License import java.io.IOException; public class Main { public static IOException toIOException(Exception e) { return e instanceof IOException ? (IOException) e : new IOException(e); }/*from ww w.j a va 2 s.co m*/ }