Adds flush() to ensure the file contents are available in the following procedure.
This commit is contained in:
parent
4e84a7cfe8
commit
ab87227014
|
@ -262,6 +262,8 @@ abstract class SitemapGenerator<U extends ISitemapUrl, THIS extends SitemapGener
|
|||
}
|
||||
|
||||
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