code: public String readFromFile(String fileName) {
      String content = null;
      BufferedReader br = null;
      try {
        File inFile = new File(fileName);
        br = new BufferedReader(new InputStreamReader(
            new FileInputStream(inFile)));
        content = "";
        while(br.ready()) {
        	content += br.readLine();
        }
        br.close();
      } catch (FileNotFoundException ex) {
      	log.error("Failed to find file.", ex);
      } catch (IOException ex) {
      	log.error("Failed to read file.", ex);
      } finally {
      	if(br != null) {
      		try {
      			br.close();
      		} catch(Exception e){}
      	}
      }
      return content;
    }
docs: /*
  Reads data from a given file