Adds flush() to ensure the file contents are available in the following procedure.
This commit is contained in:
parent
4e84a7cfe8
commit
ab87227014
|
@ -260,8 +260,10 @@ abstract class SitemapGenerator<U extends ISitemapUrl, THIS extends SitemapGener
|
|||
} else {
|
||||
out = new OutputStreamWriter(new FileOutputStream(outFile), Charset.forName("UTF-8").newEncoder());
|
||||
}
|
||||
|
||||
|
||||
writeSiteMap(out);
|
||||
out.flush();
|
||||
|
||||
if (autoValidate) SitemapValidator.validateWebSitemap(outFile);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Problem writing sitemap file " + outFile, e);
|
||||
|
|
|
@ -228,6 +228,8 @@ public class SitemapIndexGenerator {
|
|||
// TODO gzip? is that legal for a sitemap index?
|
||||
out = new FileWriter(outFile);
|
||||
writeSiteMap(out);
|
||||
out.flush();
|
||||
|
||||
if (autoValidate) SitemapValidator.validateSitemapIndex(outFile);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Problem writing sitemap index file " + outFile, e);
|
||||
|
|
Loading…
Reference in New Issue