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

biz.paluch.logging.gelf.intern.Closer Maven / Gradle / Ivy

There is a newer version: 1.15.1
Show newest version
package biz.paluch.logging.gelf.intern;

import java.io.Closeable;
import java.io.IOException;
import java.net.Socket;

/**
 * @author Mark Paluch
 * @since 17.07.14 10:45
 */
public class Closer {

    /**
     * Close silently the closeable.
     * 
     * @param closeable
     */
    public final static void close(Closeable closeable) {
        try {
            if (closeable != null) {
                closeable.close();
            }
        } catch (IOException e) {
            // ignore
        }
    }

    /**
     * Close silently the socket.
     * 
     * @param socket
     */
    public final static void close(Socket socket) {
        try {
            if (socket != null) {
                socket.close();
            }
        } catch (IOException e) {
            // ignore
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy