Here you can find the source of readFile(String path)
public static Vector<String> readFile(String path)
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.Vector; public class Main { /**// w w w . j av a 2 s . c om * Reads a file into a Vector of Strings */ public static Vector<String> readFile(String path) { BufferedReader reader = null; Vector<String> contents = new Vector<String>(); try { reader = new BufferedReader(new FileReader(path)); String line; while ((line = reader.readLine()) != null) contents.add(line); } catch (Exception ex) { System.err.println(ex); } finally { try { if (reader != null) reader.close(); } catch (IOException ex) { } } return contents; } }