public class URLResourceUtil extends Object
| Constructor and Description |
|---|
URLResourceUtil() |
| Modifier and Type | Method and Description |
|---|---|
static File |
asFile(String generalPath)
兼容无前缀, classpath:, file:// 的情况获取文件
如果以classpath: 定义的文件不存在会抛出IllegalArgumentException异常,以file://定义的则不会
|
static InputStream |
asStream(String generalPath)
兼容无前缀, classpath:, file:// 的情况打开文件成Stream
|
static URI |
toURI(String location) |
public static File asFile(String generalPath) throws IOException
IOExceptionpublic static InputStream asStream(String generalPath) throws IOException
IOExceptionpublic static URI toURI(String location) throws URISyntaxException
URISyntaxExceptionCopyright © 2018. All rights reserved.