Here you can find the source of closeWarnOnError(Closeable stream, Logger log, String message)
static boolean closeWarnOnError(Closeable stream, Logger log, String message)
//package com.java2s; import java.io.Closeable; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; public class Main { static boolean closeWarnOnError(Closeable stream, Logger log, String message) { if (stream != null) { try { stream.close();/* w w w. j av a 2 s . c o m*/ } catch (IOException e) { if (message == null) message = "Error while attempting to close"; log.log(Level.WARNING, message + ": ", e); return false; } } return true; } static boolean closeWarnOnError(Closeable stream, Logger log) { return closeWarnOnError(stream, log, null); } }