public class CloseableUtil {
+ private CloseableUtil() {
+ }
+
public static void closeAll(Iterable<? extends AutoCloseable> autoCloseables) throws Exception {
Exception lastException = null;
for (AutoCloseable autoCloseable : autoCloseables) {
if (lastException != null) {
throw lastException;
}
-
}
}