Class Closeables


  • @Deprecated
    public final class Closeables
    extends Object
    Deprecated.
    will be removed in 2.0.0. Use Java try-with-resource instead.
    Utility for working with Closeabless
    • Method Detail

      • close

        public static void close​(Closeable c)
                          throws IOException
        Deprecated.
        Closes a (potentially null) closeable.
        Parameters:
        c - can be null
        Throws:
        IOException - if c.close() throws an IOException.
      • closeAndSwallowIOExceptions

        public static void closeAndSwallowIOExceptions​(Closeable c)
        Deprecated.
        Closes a (potentially null) closeable, swallowing any IOExceptions thrown by c.close(). The exception will be logged.
        Parameters:
        c - can be null