o MAVEN-313: Less debugging info shown to console (check maven.log), more link types checked (img, link, script)
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113075 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
b005a83ceb
commit
8bfddb188d
2 files changed
+17
-15
No files matched your search
@@ -75,7 +75,7 @@ import org.w3c.tidy.Tidy;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:bwalding@apache.org">Ben Walding</a>
|
||||
* @version $Id: FileToCheck.java,v 1.7 2003/03/07 08:37:21 bwalding Exp $
|
||||
* @version $Id: FileToCheck.java,v 1.8 2003/03/07 21:44:45 bwalding Exp $
|
||||
*
|
||||
*/
|
||||
public class FileToCheck
|
||||
@@ -114,12 +114,12 @@ public class FileToCheck
|
||||
|
||||
try
|
||||
{
|
||||
System.out.println("Processing: " + fileToCheck);
|
||||
FileInputStream in = new FileInputStream(fileToCheck);
|
||||
tidy.setMakeClean(true);
|
||||
tidy.setXmlTags(true);
|
||||
tidy.setXmlOut(true);
|
||||
tidy.setQuiet(false);
|
||||
tidy.setQuiet(true);
|
||||
tidy.setShowWarnings(false);
|
||||
|
||||
tidy.setXHTML(true);
|
||||
org.w3c.dom.Document domDocument = tidy.parseDOM(in, null);
|
||||
@@ -132,12 +132,20 @@ public class FileToCheck
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
System.err.println(e.toString());
|
||||
System.out.println("While processing " + fileToCheck + " : " + e.toString());
|
||||
}
|
||||
|
||||
|
||||
List xpathResults = new ArrayList();
|
||||
|
||||
xpathResults.addAll(doc.selectNodes("//a/@href"));
|
||||
xpathResults.addAll(doc.selectNodes("//img/@src"));
|
||||
//<link rel="stylesheet" href="...">
|
||||
xpathResults.addAll(doc.selectNodes("//link/@href"));
|
||||
//<script src="http://ar.atwola.com/file/adsWrapper.js">
|
||||
xpathResults.addAll(doc.selectNodes("//script/@src"));
|
||||
|
||||
|
||||
|
||||
Map uniqueLinks = new HashMap();
|
||||
Iterator linkIter = xpathResults.iterator();
|
||||
|
||||
@@ -56,11 +56,6 @@ package org.apache.maven.linkcheck.validation;
|
||||
* ====================================================================
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
|
||||
import org.apache.commons.httpclient.Credentials;
|
||||
import org.apache.commons.httpclient.HostConfiguration;
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpState;
|
||||
@@ -68,12 +63,11 @@ import org.apache.commons.httpclient.UsernamePasswordCredentials;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.maven.util.HttpUtils;
|
||||
|
||||
/**
|
||||
* Checks links which are normal URLs
|
||||
* @author <a href="mailto:bwalding@apache.org">Ben Walding</a>
|
||||
* @version $Id: HTTPLinkValidator.java,v 1.4 2003/03/07 08:27:02 bwalding Exp $
|
||||
* @version $Id: HTTPLinkValidator.java,v 1.5 2003/03/07 21:44:45 bwalding Exp $
|
||||
*/
|
||||
public class HTTPLinkValidator implements LinkValidator
|
||||
{
|
||||
@@ -98,7 +92,7 @@ public class HTTPLinkValidator implements LinkValidator
|
||||
if (proxyHost == null)
|
||||
{
|
||||
proxy = false;
|
||||
LOG.info("Not using a proxy");
|
||||
LOG.debug("Not using a proxy");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -107,9 +101,9 @@ public class HTTPLinkValidator implements LinkValidator
|
||||
this.proxyPass = proxyPass;
|
||||
this.proxyUser = proxyUser;
|
||||
this.proxyPort = Integer.parseInt(proxyPort);
|
||||
LOG.info("Using Proxy Host:" + proxyHost);
|
||||
LOG.info("Using Proxy Port:" + proxyPort);
|
||||
LOG.info("Using Proxy User:" + proxyUser);
|
||||
LOG.debug("Using Proxy Host:" + proxyHost);
|
||||
LOG.debug("Using Proxy Port:" + proxyPort);
|
||||
LOG.debug("Using Proxy User:" + proxyUser);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user