Here you can find the source of printFileContent(String filePath)
private static void printFileContent(String filePath)
//package com.java2s; import java.io.*; public class Main { private static void printFileContent(String filePath) { File file = new File(filePath); BufferedReader reader = null; try {/* ww w . j a va 2 s. com*/ reader = new BufferedReader(new java.io.FileReader(file)); String line = null; while ((line = reader.readLine()) != null) { System.out.println(line); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { if (reader != null) { reader.close(); } } catch (IOException e) { e.printStackTrace(); } } } }