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); }
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()); } }
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; }
private Name parseOrigin(MyStringTokenizer st) throws IOException { if (!st.hasMoreTokens()) throw new IOException("Missing ORIGIN"); return new Name(st.nextToken()); }
private int parseTTL(MyStringTokenizer st) throws IOException { if (!st.hasMoreTokens()) throw new IOException("Missing TTL"); return Integer.parseInt(st.nextToken()); }