5

获取文件

 2 years ago
source link: https://wakzz.cn/2018/05/31/java/%E8%8E%B7%E5%8F%96%E6%96%87%E4%BB%B6/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

获取文件

祈雨的博客
2018-05-31
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;


PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
Resource resource = resolver.getResource("classpath:test.dat");
Resource resource2 = resolver.getResource("file:C:/test.dat");
Resource resource3 = resolver.getResource("WEB-INF/test.dat");

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK