| 106 | } |
| 107 | |
| 108 | public static void main(String[] args) throws Exception { |
| 109 | |
| 110 | String usage = "Usage: URLFilterChecker (-filterName filterName | -allCombined)"; |
| 111 | |
| 112 | if (args.length == 0) { |
| 113 | System.err.println(usage); |
| 114 | System.exit(-1); |
| 115 | } |
| 116 | |
| 117 | String filterName = null; |
| 118 | if (args[0].equals("-filterName")) { |
| 119 | if (args.length != 2) { |
| 120 | System.err.println(usage); |
| 121 | System.exit(-1); |
| 122 | } |
| 123 | filterName = args[1]; |
| 124 | } |
| 125 | |
| 126 | URLFilterChecker checker = new URLFilterChecker(NutchConfiguration.create()); |
| 127 | if (filterName != null) { |
| 128 | checker.checkOne(filterName); |
| 129 | } else { |
| 130 | checker.checkAll(); |
| 131 | } |
| 132 | |
| 133 | System.exit(0); |
| 134 | } |
| 135 | } |