package com.uno.app;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

import org.apache.commons.io.FileUtils;

public class Main{
	public static void main(String [] args) {
		
		if(args.length != 1){
			throw new RuntimeException("Needs a pom file to read");
		}
		MavenAccessObject mao = new MavenAccessObject();
		
		PackageElement parent = new PackageElement();
		File file = new File("output");
		if (!file.exists()) {
			if (file.mkdir()) {
				System.out.println("Directory is created!");
			} else {
				System.out.println("Failed to create directory!");
			}
		}
		ArrayList<PackageElement> list = mao.getDependencies(args[0], parent);
		
		try {
			FileUtils.deleteDirectory(new File("pomdump"));
			FileUtils.deleteDirectory(new File("jardump"));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}

@@ -220,10 +220,9 @@
 gth 
-!=
+%3C
  1)%7B
@@ -669,16 +669,170 @@
 nt);%0A%09%09%0A
+%09%09if (args.length %3E 1 && args%5B1%5D.equals(%22-p%22)) %7B%0A%09%09%09System.out.println(%22%5Cn--DEPENDENCY TREE--%5Cn%22);%0A%09%09%09printTree(list, 0);%0A%09%09%09System.out.println();%0A%09%09%7D%0A%09%09%0A
 %09%09try %7B%0A
@@ -999,16 +999,16 @@
 h block%0A
-
 %09%09%09e.pri
@@ -1030,10 +1030,378 @@
 %0A%09%09%7D%0A%09%7D%0A
+%09%0A%09private static void printTree(ArrayList%3CPackageElement%3E list, int depth) %7B%0A%09%09//Print each item, then recursively print their children%0A%09%09for (PackageElement pkg : list) %7B%0A%09%09%09for (int i = 0; i %3C depth; i++) %7B%0A%09%09%09%09System.out.print(%22...%22);%0A%09%09%09%7D%0A%09%09%09System.out.println(pkg.getArtifactID() + %22-%22 + pkg.getVersion());%0A%09%09%09printTree(pkg.getDependencies(), depth + 1);%0A%09%09%7D%0A%09%7D%0A
 %7D%0A

add tree output utility