public class RsExplorer extends AbstractUriExplorer
RsExplorer can be used to selectively explore the hierarchy of ResourceSync sitemaps at a remote site.
In addition to this, it also verifies the validity of the various links between these sitemaps.
The result of each request to an individual URI is gathered in a Result
; all results are
gathered in a ResultIndex
.
RsExplorer can begin with any URI that points to a ResourceSync sitemap on the site
that is the subject of exploration, regardless of what capability that start document may have. With default
settings RsExplorer will navigate and index the complete tree of documents.
There are three switches to influence the path the RsExplorer will take through the sitemap tree:
followParentLinks
, followChildLinks
and followIndexLinks
.
Modifier and Type | Field and Description |
---|---|
boolean |
followChildLinks |
boolean |
followIndexLinks |
boolean |
followParentLinks |
Constructor and Description |
---|
RsExplorer(org.apache.http.impl.client.CloseableHttpClient httpClient,
ResourceSyncContext rsContext) |
Modifier and Type | Method and Description |
---|---|
ResultIndex |
explore(URI uri) |
Result<RsRoot> |
explore(URI uri,
ResultIndex index) |
RsExplorer |
withConverter(LambdaUtil.BiFunction_WithExceptions<URI,org.apache.http.HttpResponse,RsRoot,Exception> converter) |
RsExplorer |
withFollowChildLinks(boolean follow) |
RsExplorer |
withFollowIndexLinks(boolean follow) |
RsExplorer |
withFollowParentLinks(boolean follow)
Follow links in child element <rs:ln> of <urlset>
with the relation type
up . |
execute, getCharset, getCurrentUri, getHttpClient, isKeepingHeaders, setKeepingHeaders
public boolean followParentLinks
public boolean followIndexLinks
public boolean followChildLinks
public RsExplorer(org.apache.http.impl.client.CloseableHttpClient httpClient, ResourceSyncContext rsContext)
public RsExplorer withFollowParentLinks(boolean follow)
up
. Default is true
. Set to false
if you want to prevent following links to parent documents.follow
- true
if following parent links, false
otherwise.this
to enable method chainingpublic RsExplorer withFollowIndexLinks(boolean follow)
public RsExplorer withFollowChildLinks(boolean follow)
public RsExplorer withConverter(LambdaUtil.BiFunction_WithExceptions<URI,org.apache.http.HttpResponse,RsRoot,Exception> converter)
public ResultIndex explore(URI uri)
public Result<RsRoot> explore(URI uri, ResultIndex index)
explore
in class AbstractUriExplorer
Copyright © 2017. All rights reserved.