public static String readFile(String pathname) {

		File file = new File(pathname);
	    StringBuilder fileContents = new StringBuilder((int)file.length());
		Scanner scanner = null;
		try {
			scanner = new Scanner(file);
		} catch (FileNotFoundException e) {
			System.err.println("FILE PATH INVALID");
			e.printStackTrace();

		}
		String lineSeparator = System.getProperty("line.separator");

		try {
			if (scanner != null) {
				while (scanner.hasNextLine()) {
					fileContents.append(scanner.nextLine()).append(lineSeparator);
				}
			}
			return fileContents.toString();

		} finally {
			if (scanner != null) scanner.close();
		}
	}