public class SuppressedCloseable extends Object implements Closeable
Closeable that closes the given Closeables in
order, suppressing intermediate exceptions.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the contained
Closeables in order. |
static SuppressedCloseable |
create(Closeable first,
Closeable... others) |
static SuppressedCloseable |
create(List<? extends Closeable> closeables) |
public static SuppressedCloseable create(Closeable first, Closeable... others)
public static SuppressedCloseable create(List<? extends Closeable> closeables)
public void close()
throws IOException
Closeables in order. If any close()
method throws an IOException, it is caught and the first such
exception suppresses any future exceptions.close in interface Closeableclose in interface AutoCloseableIOException