| java.lang.Object nl.hippo.util.LinkChecker
LinkChecker | final public class LinkChecker (Code) | | Check for broken links.
author: Ugo Cei version: $Id: LinkChecker.java 861 2006-02-09 10:08:30Z ucei $ |
COLUMN_SEPARATOR_CHAR | final public static char COLUMN_SEPARATOR_CHAR(Code) | | |
HTTP_ERROR_PREFIX | final public static String HTTP_ERROR_PREFIX(Code) | | |
PLACEHOLDER_TEXT_AFTER | final public static String PLACEHOLDER_TEXT_AFTER(Code) | | |
PLACEHOLDER_TEXT_BEFORE | final public static String PLACEHOLDER_TEXT_BEFORE(Code) | | |
URL_SEPARATOR_CHARS | final public static String URL_SEPARATOR_CHARS(Code) | | |
checkLinks | public static Map checkLinks(String repository, String username, String password, byte[] data) throws IOException(Code) | | Check for broken links. Expects as input an array of bytes with the contents of a text file.
Each line in the file should contain a page URL from the repository, followed by a tab
character and a space-separated list of link URLs to be checked.
Only external links (i.e. those not beginning with a forward slash) will be checked.
HTTP links are verified by doing a HEAD request and checking that the result code is less
than 300.
During processing a placeholder file will be placed in the repository.
Parameters: repository - URL of the placeholder file. Parameters: username - Username for connecting to the repository. Parameters: password - Password for connecting to the repository. Parameters: data - Input data. A map whose keys are the page URLs and whose values are Lists. Each item of the listis an array of two strings; first string is the link URL, second one is a message detailingwhy the link is considered broken. throws: IOException - |
putResults | public static void putResults(String repository, String username, String password, Map pages) throws IOException(Code) | | Save the results of link checking to a repository file.
Parameters: repository - URL of the output file. Parameters: username - Username for connecting to the repository. Parameters: password - Password for connecting to the repository. Parameters: pages - Broken links data. throws: IOException - |
|
|