MCPcopy Create free account
hub / github.com/apache/nutch / main

Method main

src/java/org/apache/nutch/api/NutchServer.java:369–396  ·  view source on GitHub ↗

Main method for NutchServer to run via command line. @param args arguments for log level, stopping the Server and port. @throws Exception exception

(String[] args)

Source from the content-addressed store, hash-verified

367 * @throws Exception exception
368 */
369 public static void main(String[] args) throws Exception {
370 CommandLineParser parser = new PosixParser();
371 Options options = createOptions();
372 CommandLine commandLine = parser.parse(options, args);
373
374 if (commandLine.hasOption(CMD_HELP)) {
375 HelpFormatter formatter = new HelpFormatter();
376 formatter.printHelp("NutchServer", options, true);
377 return;
378 }
379
380 if (commandLine.hasOption(CMD_LOG_LEVEL)) {
381 logLevel = commandLine.getOptionValue(CMD_LOG_LEVEL);
382 }
383
384 if (commandLine.hasOption(CMD_PORT)) {
385 port = Integer.parseInt(commandLine.getOptionValue(CMD_PORT));
386 }
387
388 if (commandLine.hasOption(CMD_STOP)) {
389 String stopParameter = commandLine.getOptionValue(CMD_STOP);
390 boolean force = StringUtils.equals("force", stopParameter);
391 stopRemoteServer(force);
392 return;
393 }
394
395 startServer();
396 }
397
398 private static void startServer() {
399 NutchServer server = new NutchServer();

Callers

nothing calls this directly

Calls 5

createOptionsMethod · 0.95
stopRemoteServerMethod · 0.95
startServerMethod · 0.95
parseMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected