| 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 |