version 3.1
Added method addPages(Collection, Function), which simplifies population of sitemap using functional style of programming:
File file = new File("/var/www/sitemap.xml");
List<String> pages = Arrays.asList("firstPage", "secondPage", "otherPage");
// create web sitemap for web http://www.javavids.com
new SitemapGenerator("http://www.javavids.com")
.addPage(WebPage.builder().nameRoot().priorityMax().changeFreqNever().lastModNow().build())
.addPages(urls, page -> WebPage.builder().name("dir/" + page).priorityMax().changeFreqNever().lastModNow().build())
.constructAndSaveSitemap(file);
Also on WebPageBuilder added nameRoot() method, which is short hand for name("")