All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zalando.riptide.httpclient.Closing Maven / Gradle / Ivy

There is a newer version: 4.1.0
Show newest version
package org.zalando.riptide.httpclient;

import com.google.common.annotations.VisibleForTesting;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Nullable;
import java.io.Closeable;
import java.io.IOException;

@Slf4j
final class Closing {

    private Closing() {
        // nothing to do
    }

    @VisibleForTesting
    static void closeQuietly(@Nullable final Object object) {
        if (object instanceof Closeable) {
            try {
                ((Closeable) object).close();
            } catch (final IOException e) {
                log.warn("IOException thrown while closing Closeable.", e);
            }
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy