Java tutorial
//package com.java2s; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; public class Main { public static String contentFromFixture(String fixtureName) { BufferedReader br; StringBuilder sb = new StringBuilder(); try { br = new BufferedReader( new FileReader("/Users/chang/eclipse/workspace/BasicBlock/src/fixtures/" + fixtureName)); String line = null; while ((line = br.readLine()) != null) { sb.append(line); } br.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return sb.toString(); } }