public class LinkCheckerSettings
extends java.lang.Object
LinkChecker
. The settings
are used as a "linkchecker context" that holds the base-ref and
context uri, and to control the actual rewrite behavior.
If "request" is not attached, they are used merely temporary before the
actual linkchecker is initialized.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REQUEST_ATTRIBUTE_NAME
the name of the request attribute
|
Constructor and Description |
---|
LinkCheckerSettings() |
Modifier and Type | Method and Description |
---|---|
static LinkCheckerSettings |
fromRequest(SlingHttpServletRequest request)
Returns the current link checker settings for the current request.
|
java.lang.String |
getBaseRef()
Get the current base ref.
|
java.net.URI |
getBaseURI()
Returns the base URI of the request associated with the given
settings.
|
java.lang.String |
getContextPath()
Returns the context path
|
java.net.URI |
getContextURI()
Returns the context URI of the web application associated with the
given settings.
|
LinkRewriteConfig |
getExpiredConfig()
Returns the config for expired links
|
LinkRewriteConfig |
getInvalidConfig()
Returns the config for invalid links
|
java.lang.String |
getParentRequestURI()
Return a uri to the parent of the current uri.
|
LinkRewriteConfig |
getPredatedConfig()
Returns the config for predated links
|
SlingHttpServletRequest |
getRequest() |
java.lang.String |
getRequestURI()
Get the current request uri.
|
ResourceResolver |
getResourceResolver()
Returns the resource resolver
|
void |
init(SlingHttpServletRequest request)
Attach the settings to the request.
|
boolean |
isIgnoreExternals()
If
true , external links are not checked |
boolean |
isIgnoreInternals()
If
true internal links are not checked |
void |
setBaseRef(java.lang.String baseRef)
Set the current base ref.
|
void |
setExpiredConfig(LinkRewriteConfig config)
Sets the config for expired links
|
boolean |
setIgnoreExternals(boolean ignoreExternals)
Controls if external links should be checked by the linkchecker.
|
boolean |
setIgnoreInternals(boolean ignoreInternals)
Controls if internal links should be checked by the linkchecker.
|
void |
setInvalidConfig(LinkRewriteConfig config)
Sets the config for invalid links
|
void |
setPredatedConfig(LinkRewriteConfig config)
Sets the config for predated links
|
public static final java.lang.String REQUEST_ATTRIBUTE_NAME
public static LinkCheckerSettings fromRequest(SlingHttpServletRequest request)
request
- the requestnull
public void init(SlingHttpServletRequest request)
request
- The current requestpublic SlingHttpServletRequest getRequest()
public ResourceResolver getResourceResolver()
public java.lang.String getContextPath()
public java.net.URI getContextURI()
null
if the URI malformedpublic LinkRewriteConfig getInvalidConfig()
public void setInvalidConfig(LinkRewriteConfig config)
config
- the configpublic LinkRewriteConfig getExpiredConfig()
public void setExpiredConfig(LinkRewriteConfig config)
config
- the configpublic LinkRewriteConfig getPredatedConfig()
public void setPredatedConfig(LinkRewriteConfig config)
config
- the configpublic java.lang.String getRequestURI()
public java.lang.String getParentRequestURI()
public java.lang.String getBaseRef()
public java.net.URI getBaseURI()
null
if the URI malformedpublic void setBaseRef(java.lang.String baseRef)
baseRef
- the base hrefpublic boolean isIgnoreInternals()
true
internal links are not checkedtrue
if internal links are not checkedpublic boolean setIgnoreInternals(boolean ignoreInternals)
true
all internal links are treated as 'valid'.
Please note that the settings are directly used by the linkchecker transformer
and are respected on a "startElement" event. When altered on-the-fly in a
JSP don't forget to flush the writer before changing the value.ignoreInternals
- if true
internal links are not checkedpublic boolean isIgnoreExternals()
true
, external links are not checkedtrue
if external links are not checkedpublic boolean setIgnoreExternals(boolean ignoreExternals)
true
all external links are treated as 'valid' and
they are also not recorded in the external-link storage.
Please note that the settings are directly used by the linkchecker transformer
and are respected on a "startElement" event. When altered on-the-fly in a
JSP don't forget to flush the writer before changing the value.ignoreExternals
- if true
external links are not checkedCopyright © 2010 - 2020 Adobe. All Rights Reserved