public static void dumpArrayOfLinesToFile(
		File file, 
		String encoding, 
		List lines, 
		List lineEndings
	) {
		try {
			// Create Parent Directories
			File parent = new File(file.getParent());
			parent.mkdirs();
			
			// Write the File
			Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), encoding));
			for (int i = 0; i < lines.size(); i++) {
				String line = (String) lines.get(i);
				String lineEnding = (String) lineEndings.get(i);
				if (line != null) {
					out.write(line);
				}
				if (lineEnding != null) {
					out.write(lineEnding);
				}
			}
			out.flush();
			out.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}