获得classpath路径
String classpath = this.getClass().getResource("/").getPath().replaceFirst("/", "");
获得classpath路径path,类似于:
/F:/apache-tomcat-8.0.53/webapps/caijunweb/WEB-INF/classes/
path+"foldername/filename.xxx"就可以获取resources下的文件路径
把WEB-INF/classes截取就能获得WebAPP的目录
String webappRoot = classpath.replaceAll("WEB-INF/classes/", "");
通过这个路径你就能获取该文件夹下的所有文件