Here you can find the source of readFile(String fileName)
public static String readFile(String fileName) throws IOException
//package com.java2s; //License from project: Apache License import java.io.*; import java.util.*; public class Main { /**/*w ww .ja v a2s .c o m*/ * Reads a file relative to the CMPUT391 directory and returns a String. */ public static String readFile(String fileName) throws IOException { File inFile = new File("catalina/webapps/CMPUT391F/" + fileName); //throw new IOException("EXPECTED FILE: "+inFile.getAbsolutePath()); String out = ""; Scanner scanner = new Scanner(new FileInputStream(inFile)); out = scanner.useDelimiter("\\Z").next(); return out; } }