Class Closer


  • public final class Closer
    extends java.lang.Object
    Closes resources.
    Since:
    5.0
    • Constructor Summary

      Constructors 
      Constructor Description
      Closer()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void close​(java.io.Closeable closeable)
      Closes the given Closeable in a null-safe manner.
      static void close​(ModalCloseable closeable, CloseMode closeMode)
      Closes the given Closeable in a null-safe manner.
      static void closeQuietly​(java.io.Closeable closeable)
      Closes the given Closeable quietly in a null-safe manner even in the event of an exception.
      • Methods inherited from class java.lang.Object

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

      • Closer

        public Closer()
    • Method Detail

      • close

        public static void close​(java.io.Closeable closeable)
                          throws java.io.IOException
        Closes the given Closeable in a null-safe manner.
        Parameters:
        closeable - what to close.
        Throws:
        java.io.IOException
      • close

        public static void close​(ModalCloseable closeable,
                                 CloseMode closeMode)
        Closes the given Closeable in a null-safe manner.
        Parameters:
        closeable - what to close.
        closeMode - How to close the given resource.
      • closeQuietly

        public static void closeQuietly​(java.io.Closeable closeable)
        Closes the given Closeable quietly in a null-safe manner even in the event of an exception.
        Parameters:
        closeable - what to close.