@Test
public void test() {
basePackage("com.yyc");
}
public void basePackage(String basePath) {
String basePath1 = basePath.replaceAll("\\.", "/");
URL url = this.getClass().getClassLoader().getResource(basePath1);
String fileStr = url.getFile();
File file = new File(fileStr);
String[] filesStr = file.list();
for (String path : filesStr) {
File file2 = new File(fileStr + "\\"+path);
if (file2.isDirectory()) {
basePackage(basePath + "." + path);
} else {
System.out.println(basePath + "." + file2.getName());
}
}
}