间接获取Web项目中文件的绝对路径
2016-10-19 20:00
162 查看
@Test public void testClassPathResource() throws IOException{ //filePath为web项目根目录下的文件 String filePath="metadata/questions.xlsx"; ClassPathResource resource = new ClassPathResource(filePath); System.out.println(resource); //通过getFile()获取该文件在本地的绝对路径 System.out.println(resource.getFile()); }
相关文章推荐
- java获取web项目下文件夹或者文件的绝对路径
- 获取Web项目发布的绝对路径
- 如何获取android项目下某个文件的绝对路径
- ssm java web项目中获取文件路径
- 获取web项目的绝对路径的方法总结
- J2EE WEB项目在java类里面怎样获取项目绝对路径
- Java在WEB项目中获取文件路径
- 获取项目编译后class文件绝对路径
- 获取web项目的绝对路径的方法总结
- Java项目中根据相对路径和绝对路径获取文件的方法 getResource(name)
- 如何获取android项目下某个文件的绝对路径
- web获取项目绝对路径
- 获取web项目的绝对路径的方法总结
- Java在WEB项目中获取文件路径
- web项目中quartz使用request获取指定的文件路径
- (转)J2EE WEB项目中获取相对路径与绝对路径的方法
- web项目中quartz使用request获取指定的文件路径
- 获取web项目的绝对路径的方法总结
- Java在WEB项目中获取文件路径
- springmvc获取项目当前绝对路径,进行下载文件