public static void stringToArgs(Vector<String> vec, String s,
    boolean allowQuotedStrings) throws StringScanException {
    StringScanner scanner = new StringScanner(s);
    scanner.skipWhiteSpace();
    while (!scanner.atEnd()) {
      if (allowQuotedStrings) {
        vec.add(scanner.scanString());
      } else {
        vec.add(scanner.scanNonWhiteSpaceString());
      }
      scanner.skipWhiteSpace();
    }
  }