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