return file;
}
private void render(final Locale locale) throws IOException, MojoExecutionException, MojoFailureException {
final SiteRenderingContext context = createSiteRenderingContext(locale);
context.setInputEncoding(getInputEncoding());
context.setOutputEncoding(getOutputEncoding());
context.setValidate(validate);
if (validate) {
getLog().info("Validation is switched on, xml input documents will be validated!");
}
final ChangeFreq changeFreq = ChangeFreq.valueOf(this.changeFreq.toUpperCase());
if (changeFreq == null) {
getLog().error("Change frequency must be set or is wrong.");
return;
}
final File outputDir = getOutputDirectory(locale);
getLog().info("Generating Sitemap.");
final W3CDateFormat dateFormat = new W3CDateFormat(Pattern.DAY);
final WebSitemapGenerator generator = WebSitemapGenerator.builder(project.getUrl(), outputDir).autoValidate(validate)
.dateFormat(dateFormat).build();
new Sitemap(getOutputEncoding(), i18n).generate(project, context.getDecoration(), generator, changeFreq);
final List<File> files = generator.write();
for (final File file : files) {
getLog().info("Generated Sitemap: " + file.getPath());
}
}