in src/main/java/org/apache/maven/doxia/linkcheck/DefaultLinkCheck.java [200:269]
public LinkcheckModel execute()
throws LinkCheckException
{
if ( this.basedir == null )
{
LOG.error( "No base directory specified!" );
throw new NullPointerException( "The basedir can't be null!" );
}
if ( this.reportOutput == null )
{
LOG.warn( "No output file specified! Results will not be written!" );
}
LinkcheckModel model = new LinkcheckModel();
model.setModelEncoding( reportOutputEncoding );
model.setFiles( new LinkedList<LinkcheckFile>() );
displayMemoryConsumption();
LinkValidatorManager validator = getLinkValidatorManager();
try
{
validator.loadCache( this.linkCheckCache );
}
catch ( IOException e )
{
throw new LinkCheckException( "Could not load cache: " + e.getMessage(), e );
}
displayMemoryConsumption();
LOG.info( "Begin to check links in files..." );
try
{
findAndCheckFiles( this.basedir, model );
}
catch ( IOException e )
{
throw new LinkCheckException( "Could not scan base directory: " + basedir.getAbsolutePath(), e );
}
LOG.info( "Links checked." );
displayMemoryConsumption();
try
{
createDocument( model );
}
catch ( IOException e )
{
throw new LinkCheckException( "Could not write the linkcheck document: " + e.getMessage(), e );
}
try
{
validator.saveCache( this.linkCheckCache );
}
catch ( IOException e )
{
throw new LinkCheckException( "Could not save cache: " + e.getMessage(), e );
}
displayMemoryConsumption();
return model;
}