@Test public void mkdir() throws IOException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { MkStdDirExec intance = injector.getInstance(MkStdDirExec.class); String filePath = this.getClass().getResource("/dirinfo/").getPath() + "dirstdinfo.txt"; intance.readDirInfo(filePath); intance.parseLines(0, "#", 1, null); Field field = intance.getClass().getDeclaredField("menuInfo"); MenuInfo menuInfo1 = (MenuInfo) field.get(intance); intance.mkdir("d:\\", menuInfo1); }
public void mkdir(String rootPath,MenuInfo menuInfo) { List<MenuInfo> menuInfos = menuInfo.getNexts(); for(int i = 0; i<menuInfos.size();i++) { MenuInfo oneMenu = menuInfos.get(i); String path = rootPath+"\\"+oneMenu.getName()+"\\"; File file = new File(path); file.mkdir(); if(null != oneMenu.getNexts()) { mkdir(path,oneMenu); } } }
MkStdDirExec { public void mkdir(String rootPath,MenuInfo menuInfo) { List<MenuInfo> menuInfos = menuInfo.getNexts(); for(int i = 0; i<menuInfos.size();i++) { MenuInfo oneMenu = menuInfos.get(i); String path = rootPath+"\\"+oneMenu.getName()+"\\"; File file = new File(path); file.mkdir(); if(null != oneMenu.getNexts()) { mkdir(path,oneMenu); } } } }
MkStdDirExec { public void mkdir(String rootPath,MenuInfo menuInfo) { List<MenuInfo> menuInfos = menuInfo.getNexts(); for(int i = 0; i<menuInfos.size();i++) { MenuInfo oneMenu = menuInfos.get(i); String path = rootPath+"\\"+oneMenu.getName()+"\\"; File file = new File(path); file.mkdir(); if(null != oneMenu.getNexts()) { mkdir(path,oneMenu); } } }  }
MkStdDirExec { public void mkdir(String rootPath,MenuInfo menuInfo) { List<MenuInfo> menuInfos = menuInfo.getNexts(); for(int i = 0; i<menuInfos.size();i++) { MenuInfo oneMenu = menuInfos.get(i); String path = rootPath+"\\"+oneMenu.getName()+"\\"; File file = new File(path); file.mkdir(); if(null != oneMenu.getNexts()) { mkdir(path,oneMenu); } } }  void readDirInfo(String filePath); void parseLines(Integer fistIndex,String dot,int level,MenuInfo parentMenu); String pow(String doc,int size); String parseLineContent(String dot,String line); void mkdir(String rootPath,MenuInfo menuInfo); static void main(String[] args); }
MkStdDirExec { public void mkdir(String rootPath,MenuInfo menuInfo) { List<MenuInfo> menuInfos = menuInfo.getNexts(); for(int i = 0; i<menuInfos.size();i++) { MenuInfo oneMenu = menuInfos.get(i); String path = rootPath+"\\"+oneMenu.getName()+"\\"; File file = new File(path); file.mkdir(); if(null != oneMenu.getNexts()) { mkdir(path,oneMenu); } } }  void readDirInfo(String filePath); void parseLines(Integer fistIndex,String dot,int level,MenuInfo parentMenu); String pow(String doc,int size); String parseLineContent(String dot,String line); void mkdir(String rootPath,MenuInfo menuInfo); static void main(String[] args);  }