Невозможно сгенерировать многие xml-файлы Sitemap с использованием библиотеки sitemapgen, где я получаю следующую ошибку.
открытый класс SiteMap {public static int count = 0;
public static void main(String[] args) throws IOException {
WebSitemapGenerator webSitemapGenerator = WebSitemapGenerator.builder("http://34.224.89.46", new File("/home/arivu/Desktop/SEO")).gzip(true).build();
try {
File parentDirectory = new File("/var/www/html/tech-jobs");
parentDirectory.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
String directory = name;
String childDirectory = new StringBuilder(dir.toString()).append("/").append(name).toString();
File newFile = new File(childDirectory);
newFile.listFiles(new FilenameFilter() {
public boolean accept(File dir, String fileName) {
System.out.println(count++);
String location = "http://34.224.89.46/tech-jobs" + "/" + directory + "/" + fileName;
WebSitemapUrl webSitemapUrli;
try {
webSitemapUrli = new WebSitemapUrl.Options(location).lastMod(new Date()).priority(1.0).changeFreq(ChangeFreq.HOURLY).build();
webSitemapGenerator.addUrl(webSitemapUrli);
} catch (MalformedURLException e) {
e.printStackTrace();
}
if(count == 20) {
webSitemapGenerator.write();
webSitemapGenerator.writeSitemapsWithIndex();
}
return fileName != null;
}
});
return name != null;
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
}