Package ch.tocco.nice2.dms.impl.publish
Class RobotsTxtFilter
java.lang.Object
ch.tocco.nice2.dms.impl.publish.RobotsTxtFilter
- All Implemented Interfaces:
jakarta.servlet.Filter
This filter delivers a robots.txt. Paths which mustn't be crawled and indexed by search engine bots can be
contributed by implementing a
RobotsTxtDisallowedPathsProvider
.
--------------------------------------------------------------------
Content for non-production systems, as they should never be indexed by search engines:
User-agent: *
[... additional user agent line for each contributed additional user agent ...]
Disallow: /
--------------------------------------------------------------------
Content for production systems with disallowed content:
User-agent: *
[... additional user agent line for each contributed additional user agent ...]
Disallow: /disallowed-path/1
Disallow: /another/disallowed/path
Sitemap: {domain}/sitemap.xml
--------------------------------------------------------------------
Content for production systems without disallowed content:
User-agent: *
[... additional user agent line for each contributed additional user agent ...]
Allow: /
Sitemap: {domain}/sitemap.xml
---------------------------------------------------------------------
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
doFilter
(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) void
setAdditionalUserAgents
(List<String> additionalUserAgents) Contribution for additional user agents which must be named explicitly (e.g.void
setDisallowedPathsProviders
(List<RobotsTxtDisallowedPathsProvider> disallowedPathsProviders) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jakarta.servlet.Filter
destroy, init
-
Field Details
-
PRIORITY
public static final int PRIORITY- See Also:
-
-
Constructor Details
-
RobotsTxtFilter
-
-
Method Details
-
setAdditionalUserAgents
Contribution for additional user agents which must be named explicitly (e.g. AdsBot-Google, Googlebot, Googlebot-Image to enable crawling for Ad bots which ignore "*") -
setDisallowedPathsProviders
@Autowired(required=false) public void setDisallowedPathsProviders(List<RobotsTxtDisallowedPathsProvider> disallowedPathsProviders) -
doFilter
public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException - Specified by:
doFilter
in interfacejakarta.servlet.Filter
- Throws:
IOException
jakarta.servlet.ServletException
-