public class SuppressedCloseable extends Object implements Closeable
Closeable
that closes the given Closeable
s in
order, suppressing intermediate exceptions.Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the contained
Closeable s 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
Closeable
s in order. If any close()
method throws an IOException
, it is caught and the first such
exception suppresses any future exceptions.close
in interface Closeable
close
in interface AutoCloseable
IOException