|
@ -6,11 +6,20 @@ import java.util.Iterator; |
|
|
public class tree { |
|
|
public class tree { |
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
public static void main(String[] args) { |
|
|
|
|
|
String path; |
|
|
|
|
|
File f; |
|
|
|
|
|
|
|
|
String path = "/home/michael/Downloads"; |
|
|
|
|
|
File f = new File(path); |
|
|
|
|
|
|
|
|
if(args.length>0) { |
|
|
|
|
|
path = args[0]; |
|
|
|
|
|
f = new File(path); |
|
|
|
|
|
printDirectoryTree(f); |
|
|
|
|
|
}else { |
|
|
|
|
|
f= new File(System.getProperty("user.dir")); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
System.out.println(printDirectoryTree(f)); |
|
|
|
|
|
|
|
|
// String path = "/home/michael/Downloads"; |
|
|
|
|
|
|
|
|
|
|
|
// System.out.println(printDirectoryTree(f)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|