Here you can find the source of readLine(String path)
public static String readLine(String path) throws FileNotFoundException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class Main { public static String readLine(String path) throws FileNotFoundException { return readLine(new File(path)); }/* w w w . j a v a 2 s .co m*/ public static String readLine(File file) throws FileNotFoundException { Scanner input = new Scanner(file); String output = input.nextLine(); input.close(); return output; } }