Class CloseUtil


  • public final class CloseUtil
    extends java.lang.Object
    CloseUtil exists to provide a safe means to close anything closeable. This prevents exceptions from being thrown from within finally blocks while still providing logging of exceptions that occur during close. Exceptions during the close will be logged using the spy logging infrastructure, but will not be propagated up the stack.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static Logger logger  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private CloseUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void close​(java.io.Closeable closeable)
      Close a closeable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        private static Logger logger
    • Constructor Detail

      • CloseUtil

        private CloseUtil()
    • Method Detail

      • close

        public static void close​(java.io.Closeable closeable)
        Close a closeable.