All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tngtech.jgiven.impl.util.ResourceUtil Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version
package com.tngtech.jgiven.impl.util;

import java.io.Closeable;

import com.google.common.base.Throwables;

public class ResourceUtil {
    public static void close( Closeable... closeables ) {
        Exception t = null;
        for( Closeable c : closeables ) {
            try {
                if( c != null ) {
                    c.close();
                }
            } catch( Exception e ) {
                t = e;
            }
        }
        if( t != null ) {
            throw Throwables.propagate( t );
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy