Class Closer

java.lang.Object
org.apache.hc.core5.io.Closer

public final class Closer extends Object
Closes resources.
Since:
5.0
  • Constructor Details

    • Closer

      public Closer()
  • Method Details

    • close

      public static void close(Closeable closeable) throws IOException
      Closes the given Closeable in a null-safe manner.
      Parameters:
      closeable - what to close.
      Throws:
      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(Closeable closeable)
      Closes the given Closeable quietly in a null-safe manner even in the event of an exception.
      Parameters:
      closeable - what to close.