try {
file = new File(dir, name.substring(0, name.length() - 4));
OutputStream os = openOutputStream(file);
freemarker.process(input.getInputStream(), InstallerMojo.this, os, ftlOutputEncoding);
} catch (IOException e) {
throw new UnhandledException(e);
} finally {
closeQuietly(out);
}
} else {
file = super.apply(input);