Package com.day.cq.rewriter.linkchecker
Interface ExternalLinkChecker
-
public interface ExternalLinkChecker
Service that validates external links.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
check(java.lang.String uri)
Checks the given uri.LinkInfo
checkLink(java.lang.String link, boolean force)
Checks the given link store in the repository and checks it for validity.void
checkLinks()
Walks through the links stored in the repository and checks them for validity if necessary or removes them from the repository if they are no longer used.
-
-
-
Method Detail
-
check
int check(java.lang.String uri) throws java.net.UnknownServiceException, java.net.URISyntaxException, java.net.ConnectException, java.net.NoRouteToHostException, java.net.UnknownHostException, java.io.IOException
Checks the given uri.- Parameters:
uri
- the uri to check- Returns:
- the http status response
- Throws:
java.net.UnknownServiceException
- if the protocol is not supportedjava.net.URISyntaxException
- if the uri is malformedjava.net.ConnectException
- if the connect failedjava.net.NoRouteToHostException
- if there is no route to the hostjava.net.UnknownHostException
- if the host is unknownjava.io.IOException
- if a general I/O error occured
-
checkLinks
void checkLinks()
Walks through the links stored in the repository and checks them for validity if necessary or removes them from the repository if they are no longer used.
-
checkLink
LinkInfo checkLink(java.lang.String link, boolean force)
Checks the given link store in the repository and checks it for validity.- Parameters:
link
- link to checkforce
- iftrue
force a re-check- Returns:
- the updated link info or
null
if it was removed.
-
-