public class UrlResourceKits extends Object
兼容文件url为无前缀, classpath:, file:// 三种方式的Resource读取工具集
e.g: classpath:com/myapp/config.xml, file:///data/config.xml, /data/config.xml
参考Spring ResourceUtils
| 构造器和说明 |
|---|
UrlResourceKits() |
public static File asFile(String generalPath) throws IOException
如果以classpath: 定义的文件不存在会抛出IllegalArgumentException异常,以file://定义的则不会
IOExceptionpublic static InputStream asStream(String generalPath) throws IOException
IOExceptionpublic static URI toURI(String location) throws URISyntaxException
Copyright © 2020. All rights reserved.