Here you can find the source of readLine(String fileName)
public static String readLine(String fileName) throws Exception
//package com.java2s; import java.io.BufferedReader; import java.io.FileReader; public class Main { public static String readLine(String fileName) throws Exception { if (fileName == null) { return null; }/*from ww w .j a va2 s.c om*/ BufferedReader in = null; try { in = new BufferedReader(new FileReader(fileName)); String str = in.readLine(); if (str != null) { str = str.trim(); } return str; } catch (Exception e) { throw e; } finally { in.close(); } } }