}
}
protected final void writeGoldFileContent(String content) {
URL url = getDestUrl();
SourceControlAdapter sca = AuraUtil.getSourceControlAdapter();
try {
File f = new File(url.getFile());
boolean existed = f.exists();
if (existed && !f.canWrite() && sca.canCheckout()) {
sca.checkout(f);
}
if (!f.getParentFile().exists()) {
f.getParentFile().mkdirs();
}
OutputStreamWriter fw = new OutputStreamWriter(new FileOutputStream(f), "UTF-8");
fw.write(content);
fw.close();
if (!existed && sca.canCheckout()) {
sca.add(f);
}
} catch (Throwable t) {
throw new RuntimeException("Failed to write gold file: " + url.toString(), t);
}
}