diff --git a/README.md b/README.md index 6bbadc3..49c46bb 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Add this library to classpath: cz.jiripinkas jsitemapgenerator - 4.4 + 4.5 If you want to use "ping google / bing" functionality, also add this library to classpath: diff --git a/pom.xml b/pom.xml index fe4359d..d378eb0 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 cz.jiripinkas jsitemapgenerator - 4.4 + 4.5 jar Java sitemap generator This library generates a web sitemap and can ping Google that it has changed. This project has been diff --git a/src/main/java/cz/jiripinkas/jsitemapgenerator/generator/RssGenerator.java b/src/main/java/cz/jiripinkas/jsitemapgenerator/generator/RssGenerator.java index b19d86d..7d08f75 100644 --- a/src/main/java/cz/jiripinkas/jsitemapgenerator/generator/RssGenerator.java +++ b/src/main/java/cz/jiripinkas/jsitemapgenerator/generator/RssGenerator.java @@ -20,7 +20,10 @@ public class RssGenerator extends AbstractGenerator { private String defaultExtension; /** - * Create RssGenerator + * Creates RssGenerator. + * This constructor is public, because sometimes somebody wants RssGenerator to be + * a Spring bean and Spring wants to create a proxy which requires public constructor. + * But you shouldn't call this constructor on your own, use {@link RssGenerator#of(String, String, String)} instead. * * @param baseUrl Base URL * @param root If Base URL is root (for example http://www.javavids.com or if @@ -28,14 +31,14 @@ public class RssGenerator extends AbstractGenerator { * @param webTitle Web title * @param webDescription Web description */ - private RssGenerator(String baseUrl, boolean root, String webTitle, String webDescription) { + public RssGenerator(String baseUrl, boolean root, String webTitle, String webDescription) { super(baseUrl, root); this.webTitle = webTitle; this.webDescription = webDescription; } /** - * Create RssGenerator. Root = true. + * Creates RssGenerator. Root = true. * * @param baseUrl Base URL * @param webTitle Web title diff --git a/src/main/java/cz/jiripinkas/jsitemapgenerator/generator/SitemapGenerator.java b/src/main/java/cz/jiripinkas/jsitemapgenerator/generator/SitemapGenerator.java index b06f67e..9b391bc 100644 --- a/src/main/java/cz/jiripinkas/jsitemapgenerator/generator/SitemapGenerator.java +++ b/src/main/java/cz/jiripinkas/jsitemapgenerator/generator/SitemapGenerator.java @@ -17,9 +17,12 @@ public enum AdditionalNamespace { } /** + * This constructor is public, because sometimes somebody wants SitemapGenerator to be + * a Spring bean and Spring wants to create a proxy which requires public constructor. + * But you shouldn't call this constructor on your own, use {@link SitemapGenerator#of(String)} instead. * @param baseUrl Base URL */ - private SitemapGenerator(String baseUrl) { + public SitemapGenerator(String baseUrl) { super(baseUrl); } diff --git a/src/main/java/cz/jiripinkas/jsitemapgenerator/generator/SitemapIndexGenerator.java b/src/main/java/cz/jiripinkas/jsitemapgenerator/generator/SitemapIndexGenerator.java index 902e25b..4ccf3e6 100644 --- a/src/main/java/cz/jiripinkas/jsitemapgenerator/generator/SitemapIndexGenerator.java +++ b/src/main/java/cz/jiripinkas/jsitemapgenerator/generator/SitemapIndexGenerator.java @@ -14,9 +14,12 @@ public class SitemapIndexGenerator extends AbstractSitemapGenerator { /** - * @param baseUrl Base url + * This constructor is public, because sometimes somebody wants SitemapIndexGenerator to be + * a Spring bean and Spring wants to create a proxy which requires public constructor. + * But you shouldn't call this constructor on your own, use {@link SitemapIndexGenerator#of(String)} instead. + * @param baseUrl Base URL */ - private SitemapIndexGenerator(String baseUrl) { + public SitemapIndexGenerator(String baseUrl) { super(baseUrl); } diff --git a/src/main/java/cz/jiripinkas/jsitemapgenerator/robots/RobotsTxtGenerator.java b/src/main/java/cz/jiripinkas/jsitemapgenerator/robots/RobotsTxtGenerator.java index 6f4579b..80bf093 100644 --- a/src/main/java/cz/jiripinkas/jsitemapgenerator/robots/RobotsTxtGenerator.java +++ b/src/main/java/cz/jiripinkas/jsitemapgenerator/robots/RobotsTxtGenerator.java @@ -1,6 +1,7 @@ package cz.jiripinkas.jsitemapgenerator.robots; import cz.jiripinkas.jsitemapgenerator.UrlUtil; +import cz.jiripinkas.jsitemapgenerator.generator.SitemapGenerator; import java.util.ArrayList; import java.util.List; @@ -13,6 +14,14 @@ public class RobotsTxtGenerator { private String baseUrl; + /** + * This constructor is public, because sometimes somebody wants RobotsTxtGenerator to be + * a Spring bean and Spring wants to create a proxy which requires public constructor. + * But you shouldn't call this constructor on your own, use {@link RobotsTxtGenerator#of(String)} instead. + */ + public RobotsTxtGenerator() { + } + public static RobotsTxtGenerator of(String baseUrl) { RobotsTxtGenerator robotsTxtGenerator = new RobotsTxtGenerator(); if (!baseUrl.endsWith("/")) {