org.apache.hc.core5.io

## Class Closer

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

-     public final class Closer
      extends Object

  Closes resources.
  Since:
    5.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Closer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `close(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(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(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.

Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.