Пример #1
0
 private void parseInclude(MyStringTokenizer st) throws IOException {
   if (!st.hasMoreTokens()) throw new IOException("Missing file to include");
   File newfile;
   String filename = st.nextToken();
   if (file.getParent() == null) newfile = new File(filename);
   else newfile = new File(file.getParent(), filename);
   if (st.hasMoreTokens()) included = new Master(newfile, new Name(st.nextToken()));
   else included = new Master(newfile, origin);
 }
Пример #2
0
  public static void main(String args[]) throws IOException {

    InputStreamReader isr = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(isr);

    while (true) {
      MyStringTokenizer st = new MyStringTokenizer(br.readLine());
      while (st.hasMoreTokens()) System.out.println(st.nextToken());
    }
  }
Пример #3
0
 Record rdataFromString(Name name, short dclass, int ttl, MyStringTokenizer st, Name origin)
     throws TextParseException {
   SIGRecord rec = new SIGRecord(name, dclass, ttl);
   rec.covered = Type.value(st.nextToken());
   rec.alg = Byte.parseByte(st.nextToken());
   rec.labels = Byte.parseByte(st.nextToken());
   rec.origttl = TTL.parseTTL(st.nextToken());
   rec.expire = parseDate(st.nextToken());
   rec.timeSigned = parseDate(st.nextToken());
   rec.footprint = (short) Integer.parseInt(st.nextToken());
   rec.signer = Name.fromString(st.nextToken(), origin);
   if (st.hasMoreTokens()) rec.signature = base64.fromString(st.remainingTokens());
   return rec;
 }
Пример #4
0
 private Name parseOrigin(MyStringTokenizer st) throws IOException {
   if (!st.hasMoreTokens()) throw new IOException("Missing ORIGIN");
   return new Name(st.nextToken());
 }
Пример #5
0
 private int parseTTL(MyStringTokenizer st) throws IOException {
   if (!st.hasMoreTokens()) throw new IOException("Missing TTL");
   return Integer.parseInt(st.nextToken());
 }