Here you can find the source of closeCloseableIfNotNull(Closeable fileWriter)
public static void closeCloseableIfNotNull(Closeable fileWriter)
//package com.java2s; //License from project: Open Source License import java.io.Closeable; import java.io.IOException; public class Main { public static void closeCloseableIfNotNull(Closeable fileWriter) { if (fileWriter != null) { try { fileWriter.close();/*ww w .j a v a 2 s. c o m*/ } catch (IOException e) { e.printStackTrace(); } } } }