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

Method addTopicsFromFile

src/java/org/apache/nutch/tools/DmozParser.java:343–361  ·  view source on GitHub ↗
(String topicFile, Vector<String> topics)

Source from the content-addressed store, hash-verified

341 }
342
343 private static void addTopicsFromFile(String topicFile, Vector<String> topics)
344 throws IOException {
345 BufferedReader in = null;
346 try {
347 in = new BufferedReader(new InputStreamReader(new FileInputStream(
348 topicFile), "UTF-8"));
349 String line = null;
350 while ((line = in.readLine()) != null) {
351 topics.addElement(new String(line));
352 }
353 } catch (Exception e) {
354 if (LOG.isErrorEnabled()) {
355 LOG.error("Failed with the following exception: ", e.toString());
356 }
357 System.exit(0);
358 } finally {
359 in.close();
360 }
361 }
362
363 /**
364 * Command-line access. User may add URLs via a flat text file or the

Callers 1

mainMethod · 0.95

Calls 4

readLineMethod · 0.80
errorMethod · 0.80
closeMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected