import java.io.IOException;
import java.io.InputStream;
+import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.logging.Level;
* {@inheritDoc}
*/
public void parsedLink(InputStream inputStream, String linkTarget, String linkTitle, String linkText) {
- System.out.println("Found link to “" + linkTarget + "” named “" + linkText + "” or “" + linkTitle + "”.");
+ URL newLink = null;
+ try {
+ newLink = new URL(url, linkTarget);
+ core.addPage(newLink);
+ } catch (MalformedURLException mue1) {
+ logger.log(Level.WARNING, "Could not create URL from “" + url + "” and “" + linkTarget + "”.", mue1);
+ } catch (IllegalArgumentException iae1) {
+ logger.log(Level.WARNING, "Could not add “" + newLink + "” to core queue.", iae1);
+ }
}
/**
* {@inheritDoc}
*/
public void parsedTitle(InputStream inputStream, String title) {
- System.out.println("Found title “" + title + "”.");
}
}