Index: java/GraphTest.java
===================================================================
--- java/GraphTest.java	(revision 6b31de638ea19a82f4b9aaaa67d2bcfb4d3f7e88)
+++ java/GraphTest.java	(revision 008dc259d6f8528dff99cf5297b9439ac4987ba5)
@@ -19,7 +19,9 @@
 public class GraphTest {
     public static void main(String[] args) throws IOException {
+	File saveDir = new File(".");
         if (args.length < 3) {
             System.out.println("Usage: GraphTest <files> <role> <principal>");
-            System.out.println("    runs the query role <-?- principal and prints the result");
+            System.out.println("    runs the query role <-?- principal "
+		    + "and prints the result");
             System.exit(1);
         }
@@ -45,6 +47,8 @@
 
 	    try {
-		if (f.isDirectory()) 
+		if (f.isDirectory()) {
 		    ctxt.load_directory(f, errs);
+		    saveDir = f;
+		}
 		else if (f.getPath().endsWith(".pem")) 
 		    ctxt.load_id_file(f);
@@ -82,5 +86,5 @@
             System.out.println(c.simpleString(ctxt));
 	    if ( c.hasCertificate()) {
-		c.write(fn + n++ + suf);
+		c.write(new File(saveDir, fn + n++ + suf).toString());
 		ids.add(c.issuer());
 	    }
@@ -93,8 +97,8 @@
 	for (Identity i: ids) {
 	    System.out.println("ID: " + i);
-	    i.write(fn + n++ + suf);
+	    i.write(new File(saveDir, fn + n++ + suf).toString());
 	}
 	try {
-	    ctxt.write_zip(new File("./testout.zip"), true, true);
+	    ctxt.write_zip(new File(saveDir, "testout.zip"), true, true);
 	}
 	catch (IOException ioe) {
Index: java/Reader.java
===================================================================
--- java/Reader.java	(revision 6b31de638ea19a82f4b9aaaa67d2bcfb4d3f7e88)
+++ 	(revision )
@@ -1,79 +1,0 @@
-import java.io.*;
-import java.util.*;
-
-import edu.uci.ics.jung.graph.*;
-
-import net.deterlab.abac.CredentialFactory;
-import net.deterlab.abac.Credential;
-import net.deterlab.abac.Context;
-import net.deterlab.abac.Role;
-import net.deterlab.abac.Identity;
-
-import java.security.KeyPair;
-
-
-/**
- * Simple test of the native Java implementation of ABAC. Loads credentials
- * from an rt0 file and runs a query against them.
- */
-public class Reader {
-    public static void main(String[] args) throws IOException {
-        if (args.length < 1) {
-            System.out.println("Usage: Reader <files>");
-            System.out.println("   Reads the files and prints the credentials");
-            System.exit(1);
-        }
-
-	Context ctxt = new Context();
-	Map<String, Exception> errs = new HashMap<String, Exception>();
-
-	try {
-	    CredentialFactory cf = new CredentialFactory(
-		    new String[] {
-			"net.deterlab.abac.X509Credential",
-			"net.deterlab.abac.GENICredential"
-		    });
-	    ctxt.setCredentialFactory(cf);
-	}
-	catch (Exception e) {
-	    System.exit(20);
-	}
-
-	for (int i= 0; i < args.length; i++) {
-	    File f = new File(args[i]);
-
-	    try {
-		if (f.isDirectory()) 
-		    ctxt.load_directory(f, errs);
-		else if (f.getPath().endsWith(".pem")) 
-		    ctxt.load_id_file(f);
-		else if (f.getPath().endsWith(".der"))
-		    ctxt.load_attribute_file(f);
-		else if (f.getPath().endsWith(".xml"))
-		    ctxt.load_attribute_file(f);
-		else if (f.getPath().endsWith(".zip"))
-		    ctxt.load_zip(f, errs);
-		else if (f.getPath().endsWith(".rt0"))
-		    ctxt.load_rt0(f);
-		else
-		    System.out.println(f + " of unknown type");
-	    }
-	    catch (Exception e) {
-		System.err.println("Failed to process " + f + ": " +e);
-	    }
-	}
-
-	for (String f: errs.keySet()) System.err.println(f + " " + errs.get(f));
-
-        //
-        // run the query
-        //
-
-	System.out.println("Creds");
-        for (Credential c : ctxt.credentials()) {
-            System.out.println(c.simpleString(ctxt));
-            System.out.println(c);
-	}
-
-    }
-}
Index: java/Writer.java
===================================================================
--- java/Writer.java	(revision 6b31de638ea19a82f4b9aaaa67d2bcfb4d3f7e88)
+++ 	(revision )
@@ -1,40 +1,0 @@
-import java.io.*;
-import java.util.*;
-
-import edu.uci.ics.jung.graph.*;
-
-import net.deterlab.abac.Credential;
-import net.deterlab.abac.GENICredential;
-import net.deterlab.abac.Context;
-import net.deterlab.abac.Role;
-import net.deterlab.abac.Identity;
-
-import java.security.KeyPair;
-
-
-/**
- * Simple test of the native Java implementation of ABAC. Loads credentials
- * from an rt0 file and runs a query against them.
- */
-public class Writer {
-    public static void main(String[] args) throws IOException {
-        if (args.length < 4) {
-            System.out.println("Usage: Writer cert head tail output");
-            System.out.println("   Reads the files and prints the credentials");
-            System.exit(1);
-        }
-
-	try {
-	    Identity i = new Identity(new File(args[0]));
-	    Credential c = new GENICredential(new Role(args[1]), 
-		    new Role(args[2]));
-
-	    System.out.println(c);
-	    c.make_cert(i);
-	    c.write(args[3]);
-	}
-	catch (Exception e) {
-	    e.printStackTrace();
-	}
-    }
-}
Index: java/build.xml
===================================================================
--- java/build.xml	(revision 6b31de638ea19a82f4b9aaaa67d2bcfb4d3f7e88)
+++ java/build.xml	(revision 008dc259d6f8528dff99cf5297b9439ac4987ba5)
@@ -21,4 +21,5 @@
   <property name="build.dir" value="build"/>
   <property name="classes.dir" value="${build.dir}/classes"/>
+  <property name="example.dir" value="${src.dir}/example"/>
   <property name="jar.dir" value="${build.dir}/jar"/>
   <property name="doc.dir" value="./doc"/>
@@ -42,4 +43,5 @@
     <delete dir="${doc.dir}"/>
     <delete dir="${devdoc.dir}"/>
+    <delete dir="${example.dir}"/>
     <delete>
       <fileset dir="${basedir}" includes="**/*.der"/>
@@ -80,5 +82,5 @@
   </target>
 
-  <target name="run-test" depends="compile" description="run visualizer">
+  <target name="run-test-default" depends="compile,run-create-default" description="run test query on default example">
     <java classname="${main.class}" fork="true" >
       <classpath>
@@ -86,10 +88,34 @@
 	<pathelement path="${classes.dir}"/>
       </classpath>
-      <!-- <arg file="../examples/experiment_create/"/> -->
-      <arg file="./example"/>
+      <arg file="./example/default"/>
       <arg value="Acme.experiment_create"/>
       <arg value="Bob"/>
     </java>
   </target>
+
+  <target name="run-test-x509" depends="compile,run-create-x509" description="run test query on X.509 example">
+    <java classname="${main.class}" fork="true" >
+      <classpath>
+	<path refid="compile.classpath"/>
+	<pathelement path="${classes.dir}"/>
+      </classpath>
+      <arg file="./example/X509Credential"/>
+      <arg value="Acme.experiment_create"/>
+      <arg value="Bob"/>
+    </java>
+  </target>
+
+  <target name="run-test-geni" depends="compile,run-create-geni" description="run test query on GENI example">
+    <java classname="${main.class}" fork="true" >
+      <classpath>
+	<path refid="compile.classpath"/>
+	<pathelement path="${classes.dir}"/>
+      </classpath>
+      <arg file="./example/GENICredential"/>
+      <arg value="Acme.experiment_create"/>
+      <arg value="Bob"/>
+    </java>
+  </target>
+  <target name="run-test" depends="run-test-default,run-test-x509,run-test-geni" description="Run all the test queries"/>
 
   <target name="run-dump" depends="compile" description="run dumper">
@@ -103,28 +129,5 @@
   </target>
 
-  <target name="run-read" depends="compile" description="run visualizer">
-    <java classname="${read.class}" fork="true" >
-      <classpath>
-	<path refid="compile.classpath"/>
-	<pathelement path="${classes.dir}"/>
-      </classpath>
-      <arg file="./example"/>
-    </java>
-  </target>
-
-  <target name="run-write" depends="compile" description="run visualizer">
-    <java classname="${write.class}" fork="true" >
-      <classpath>
-	<path refid="compile.classpath"/>
-	<pathelement path="${classes.dir}"/>
-      </classpath>
-      <arg file="./fedid.pem"/>
-      <arg value="0a778934b93d546406d195d18e4f208af11ea84a.experiment_create"/>
-      <arg value="Bob"/>
-      <arg file="./test.xml"/>
-    </java>
-  </target>
-
-  <target name="run-create" depends="compile" description="run visualizer">
+  <target name="run-create-default" depends="compile" description="Create example certs in default format">
     <java classname="${example.class}" fork="true" >
       <classpath>
@@ -136,5 +139,5 @@
   </target>
 
-  <target name="run-create-geni" depends="compile" description="run visualizer">
+  <target name="run-create-geni" depends="compile" description="Create example certs in GENI format">
     <java classname="${example.class}" fork="true" >
       <classpath>
@@ -146,5 +149,5 @@
   </target>
 
-  <target name="run-create-x509" depends="compile" description="run visualizer">
+  <target name="run-create-x509" depends="compile" description="Create example certs in X.509 format">
     <java classname="${example.class}" fork="true" >
       <classpath>
@@ -155,3 +158,5 @@
     </java>
   </target>
+
+  <target name="run-create" depends="run-create-default,run-create-x509,run-create-geni" description="Create all the examples"/>
 </project>
