add addDirectory method to Directory.java