示例#1
0
  private void addToURLs(String baseURL, String strings[]) {
    logger.entering(baseURL);
    logger.entering(strings);

    for (int i = 0; i < strings.length; i++) {
      String next = replaceAll(strings[i], args.URLFixUp);

      String newBase = newBase(next);
      if (newBase != null) {
        logger.fine("Setting base to " + baseURL);
        baseURL = newBase;
      }

      String possible[] = interesting(next);

      for (int j = 0; j < args.Interesting.length; j++) {
        if (possible[j] != null) {
          URL u = makeURL(baseURL, possible[j]);

          if (u == null) continue;

          String total = u.toString();

          String PathAccept[] = args.PathAccept;
          String PathReject[] = args.PathReject;

          boolean accept = Utils.blurf(PathAccept, PathReject, total, true);

          if (args.PrintAccept && accept) logger.info("Accepting path: " + total);
          if (args.PrintReject && !accept) logger.info("Rejecting path: " + total);

          if (accept) {
            if (args.URLRewrite != null) total = REplican.replaceAll(total, args.URLRewrite);

            // if we don't already have it
            if (urls.get(total) == null) {
              if (args.PrintAdd) logger.info("Adding: " + total);
              addOne(total);
            }
          }
        }
      }
    }
  }
示例#2
0
 public static void main(String[] arguments) throws FileNotFoundException {
   REplican r = new REplican(arguments);
   r.doit();
 }