summaryrefslogtreecommitdiff
path: root/src/Main.java
blob: b86a8b40e1ca59440a17992a6e0e905447fe67f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// package org.noreply.fancydress.directory;

import java.io.*;
import org.noreply.fancydress.directory.parser.*;
import org.noreply.fancydress.directory.*;
import org.noreply.fancydress.type3.*;
import org.noreply.fancydress.misc.*;
import org.noreply.fancydress.type3.routing.*;
import org.noreply.fancydress.type3.mmtp.*;

public class Main {
    static public void main(String argv[]) {
    /* Start the parser */
    try {
      DirectoryParser parser = new DirectoryParser(new DirectoryLexer(new FileReader(argv[0])));
      DirectoryMessage m = (DirectoryMessage)parser.parse().value;
      Directory dir = new Directory(m, false);
      Path path = new Path(dir,"test1 : tonga");
      RoutingDestination address = new RoutingSMTP("peter@palfrader.org");
      Payload payload = new Payload();
      Packet packet = new Packet(path, address, payload);
      MMTP.send(packet);
      /*
      FileOutputStream w = new FileOutputStream("out");
      w.write(packet.asOctets());
      */

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}