org.apache.maven.doxia.linkcheck
Class DefaultLinkCheck

java.lang.Object
  extended by org.apache.maven.doxia.linkcheck.DefaultLinkCheck
All Implemented Interfaces:
LinkCheck

public final class DefaultLinkCheck
extends Object
implements LinkCheck

The main bean to be called whenever a set of documents should have their links checked.

Version:
$Id: DefaultLinkCheck.java 1002602 2010-09-29 13:09:25Z ltheussl $
Author:
Ben Walding, Carlos Sanchez, Arnaud Heritier, Vincent Siveton

Field Summary
 
Fields inherited from interface org.apache.maven.doxia.linkcheck.LinkCheck
ROLE
 
Constructor Summary
DefaultLinkCheck()
           
 
Method Summary
 LinkcheckModel execute()
          Execute the link check.
 void setBasedir(File base)
          Set the base directory for the files to be linkchecked.
 void setBaseURL(String url)
          Sets the base URL.
 void setEncoding(String encoding)
          Set the encoding to use when processing files.
 void setExcludedHttpStatusErrors(int[] excl)
          Sets the excluded HTTP errors, i.e.
 void setExcludedHttpStatusWarnings(int[] excl)
          Sets the excluded HTTP warnings, i.e.
 void setExcludedLinks(String[] excl)
          Sets the excluded links, a String[] with excluded locations.
 void setExcludedPages(String[] excl)
          Sets the excluded pages, a String[] with excluded locations.
 void setHttp(HttpBean http)
          Sets the http parameters bean.
 void setLinkCheckCache(File cacheFile)
          Sets the cache File.
 void setOnline(boolean onLine)
          Set the online mode.
 void setReportOutput(File file)
          Set the output file for the results.
 void setReportOutputEncoding(String encoding)
          Sets the outputEncoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLinkCheck

public DefaultLinkCheck()
Method Detail

setBasedir

public void setBasedir(File base)
Set the base directory for the files to be linkchecked.

Specified by:
setBasedir in interface LinkCheck
Parameters:
base - the base directory

setBaseURL

public void setBaseURL(String url)
Sets the base URL. This is prepended to links that start with '/'.

Specified by:
setBaseURL in interface LinkCheck
Parameters:
url - the base URL.

setExcludedHttpStatusErrors

public void setExcludedHttpStatusErrors(int[] excl)
Sets the excluded HTTP errors, i.e. 404, a int[] with excluded errors.

Specified by:
setExcludedHttpStatusErrors in interface LinkCheck
Parameters:
excl - The excludes to set
See Also:
HttpStatus} for all possible values.

setExcludedHttpStatusWarnings

public void setExcludedHttpStatusWarnings(int[] excl)
Sets the excluded HTTP warnings, i.e. 301, a int[] with excluded errors.

Specified by:
setExcludedHttpStatusWarnings in interface LinkCheck
Parameters:
excl - The excludes to set
See Also:
HttpStatus} for all possible values.

setExcludedLinks

public void setExcludedLinks(String[] excl)
Sets the excluded links, a String[] with excluded locations. Could contains a link, i.e. http://maven.apache.org/, or pattern links i.e. http://maven.apache.org/**/*.html

Specified by:
setExcludedLinks in interface LinkCheck
Parameters:
excl - The excludes to set

setExcludedPages

public void setExcludedPages(String[] excl)
Sets the excluded pages, a String[] with excluded locations.

Specified by:
setExcludedPages in interface LinkCheck
Parameters:
excl - The excludes to set

setHttp

public void setHttp(HttpBean http)
Sets the http parameters bean.

Specified by:
setHttp in interface LinkCheck
Parameters:
http - parameters bean.

setLinkCheckCache

public void setLinkCheckCache(File cacheFile)
Sets the cache File.

Specified by:
setLinkCheckCache in interface LinkCheck
Parameters:
cacheFile - The cacheFile to set. Set this to null to ignore storing the cache.

setOnline

public void setOnline(boolean onLine)
Set the online mode.

Specified by:
setOnline in interface LinkCheck
Parameters:
onLine - online mode.

setReportOutput

public void setReportOutput(File file)
Set the output file for the results. If this is null, no output will be written.

Specified by:
setReportOutput in interface LinkCheck
Parameters:
file - the output file.

setReportOutputEncoding

public void setReportOutputEncoding(String encoding)
Sets the outputEncoding.

Specified by:
setReportOutputEncoding in interface LinkCheck
Parameters:
encoding - The outputEncoding to set.

execute

public LinkcheckModel execute()
                       throws LinkCheckException
Execute the link check. The basedir should be set before.

Specified by:
execute in interface LinkCheck
Returns:
the analysis in a LinkCheck model.
Throws:
LinkCheckException - if any
See Also:
LinkCheck.setBasedir(File)

setEncoding

public void setEncoding(String encoding)
Set the encoding to use when processing files.

Specified by:
setEncoding in interface LinkCheck
Parameters:
encoding - a valid encoding
See Also:
Supported encodings


Copyright © 2005-2011 Apache Software Foundation. All Rights Reserved.