MCPcopy Create free account
hub / github.com/apache/solr / postWebPages

Method postWebPages

solr/core/src/java/org/apache/solr/cli/PostTool.java:587–601  ·  view source on GitHub ↗

This method takes as input a list of start URL strings for crawling, converts the URL strings to URI strings and adds each one to a backlog and then starts crawling @param args the raw input args from main() @param startIndexInArgs offset for where to start @param out outputStream to write results

(String[] args, int startIndexInArgs, OutputStream out)

Source from the content-addressed store, hash-verified

585 * @return the number of web pages posted
586 */
587 public int postWebPages(String[] args, int startIndexInArgs, OutputStream out) {
588 reset();
589 LinkedHashSet<URI> s = new LinkedHashSet<>();
590 for (int j = startIndexInArgs; j < args.length; j++) {
591 try {
592 URI uri = new URI(normalizeUrlEnding(args[j]));
593 s.add(uri);
594 } catch (URISyntaxException e) {
595 warn("Skipping malformed input URL: " + args[j]);
596 }
597 }
598 // Add URIs to level 0 of the backlog and start recursive crawling
599 backlog.add(s);
600 return webCrawl(0, out);
601 }
602
603 /**
604 * Normalizes a URL string by removing anchor part and trailing slash

Callers 2

testDoWebModeMethod · 0.95
doWebModeMethod · 0.95

Calls 5

resetMethod · 0.95
normalizeUrlEndingMethod · 0.95
warnMethod · 0.95
webCrawlMethod · 0.95
addMethod · 0.65

Tested by 1

testDoWebModeMethod · 0.76