File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
src/main/java/ru/mystamps/web/feature/site Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -67,11 +67,7 @@ public void generateSitemapXml(HttpServletResponse response) {
67
67
writer .print (INDEX_URL_ENTRY );
68
68
69
69
for (SitemapInfoDto item : seriesService .findAllForSitemap ()) {
70
- writer .print ("<url><loc>" );
71
- writer .print (createLocEntry (item ));
72
- writer .print ("</loc><lastmod>" );
73
- writer .print (createLastModEntry (dateFormatter , item ));
74
- writer .print ("</lastmod></url>\n " );
70
+ writer .print (createUrlEntry (dateFormatter , item ));
75
71
}
76
72
77
73
writer .print ("</urlset>\n " );
@@ -80,6 +76,15 @@ public void generateSitemapXml(HttpServletResponse response) {
80
76
}
81
77
}
82
78
79
+ private static String createUrlEntry (DateFormat dateFormatter , SitemapInfoDto item ) {
80
+ return new StringBuilder ("<url><loc>" )
81
+ .append (createLocEntry (item ))
82
+ .append ("</loc><lastmod>" )
83
+ .append (createLastModEntry (dateFormatter , item ))
84
+ .append ("</lastmod></url>\n " )
85
+ .toString ();
86
+ }
87
+
83
88
private static String createLocEntry (SitemapInfoDto item ) {
84
89
return SiteUrl .PUBLIC_URL
85
90
+ SeriesUrl .INFO_SERIES_PAGE .replace ("{id}" , String .valueOf (item .getId ()));
You can’t perform that action at this time.
0 commit comments