public static boolean writeFile(String fileName, String text, boolean append) {
		
		File toWrite = new File(fileName);
		
		PrintWriter pw = null;
		
		try {
			pw = new PrintWriter(toWrite);
			if (append) {
				pw.append(text);
			} else {
				pw.write(text);
			}
			pw.close();
			return true;
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} finally {
			pw.close();
		}
		
		return false;
	}