package dk.itu.mario.engine.util;

import java.io.BufferedReader;
import java.io.FileReader;

public class FileHandler {

	public static String readFile(String fileName) {
		String info = "";
		try {
			FileReader input = new FileReader(fileName);
			BufferedReader bufRead = new BufferedReader(input);

			String line;

			line = bufRead.readLine();
			info = line + "\n";

			while (line != null) {
				line = bufRead.readLine();
				info += line + "\n";
			}

			bufRead.close();

		} catch (Exception e) {
			System.out.println("Unable to read from file: " + fileName +", returning empty String.");
		}
		return info;
	}
}
