Class CloseableUtil


  • public final class CloseableUtil
    extends Object
    Utility class for handling Closeables.
    • Method Detail

      • close

        public static void close​(Object... objs)
        Close a group of objects. If an object implements AutoCloseable then the object will be closed. Any exceptions that are thrown are caught and ignored.
        Parameters:
        objs - the objects to attempt to close
      • close

        public static void close​(Object obj)
        Close an object. If the object implements AutoCloseable then the object will be closed. Any exceptions that are thrown are caught and ignored.
        Parameters:
        obj - the object to attempt to close
      • close

        public static void close​(AutoCloseable... closeable)
        Close a group of AutoCloseable objects. Any exceptions that are thrown are caught and ignored.
        Parameters:
        closeable - the objects to close
      • close

        public static void close​(AutoCloseable closeable)
        Close an AutoCloseable object. Any exceptions that are thrown are caught and ignored.
        Parameters:
        closeable - the object to close