import java.io.File; /** * Repertoires */ public class Repertoires { public static void main(String[] args) { Tree tree = new Tree<>(); File f = new File(args.length > 0 ? args[0] : "."); tree.getRootNode().setValue(f.getName()); fillNode(tree.getRootNode(), f); tree.showTree(); } public static void fillNode(Node node, File folder) { for (File f : folder.listFiles()) { Node subNode = new Node(f.getName()); if (f.isDirectory()) { fillNode(subNode, f); } node.addSubNode(subNode); } } }