public static void main(String[] args) {

        if(args.length < 1) {
			System.out.println("Insufficient args. . ERROR!");
			System.exit(1);
		}
        ArrayList<XMLFile> results =  null;
        XMLFile ret = null;

		switch(args[0].charAt(0)) {
			case 'i':
				System.out.println("Populating database.");
				populateDB(args[1], 8);
				break;
			case 'q':
				System.out.println("Performing query.");
                dbName = args[1];
				try {
                    File outFile = new File("Eric_Zounese_Assignment3");
                    if (!outFile.exists()) {
                        outFile.createNewFile();
                    }
					String line;
					BufferedReader br = new BufferedReader(new FileReader(args[2]));
                    FileWriter fw = new FileWriter(outFile.getAbsoluteFile());
                    BufferedWriter bw = new BufferedWriter(fw);
					while((line = br.readLine()) != null) {
                        bw.write("Query with the following terms ");
                        for(String token:line.split(" ")){
                            bw.write(token + " ");
                        }
                        bw.write("\n");
                        results = imdbPointQueryText(line.split(" "));
                        for(XMLFile result:results) {
                            bw.write(result.getName() + ";");
                            System.out.println(result.getName());
                        }
                        bw.write("\n");
                    }
                    bw.close();
                } catch(IOException ioe) {
                    System.out.println("Caught file exception.");
                }
        }
    }