private void handleSpecialDirectives(Directive dir) throws ParserException {
    if (dir.getName().equalsIgnoreCase("Include")) {
      List<Statement> stats = include(getParent(), dir.getValue().trim());
      _statements.addAll(stats);
    } else if (dir.getName().equalsIgnoreCase("ServerRoot")) {
      String serverRoot = dir.getValue().trim();
      if (serverRoot != null && serverRoot.startsWith("\"") && serverRoot.endsWith("\"")) {
        serverRoot = serverRoot.substring(1, serverRoot.length() - 1);
      }

      setServerRoot(serverRoot);
    }
  }
Example #2
0
 private List<Directive> parseDirectives(final StringBuilder buffer, final ParserCursor cursor) {
   List<Directive> elements = new ArrayList<Directive>();
   while (!cursor.atEnd()) {
     Directive element = parseDirective(buffer, cursor);
     if (!(element.getName().length() == 0 && element.getValue() == null)) {
       elements.add(element);
     }
   }
   return elements;
 }