public class ResourceUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
URL_PROTOCOL_FILE
URL protocol for a file in the file system: "file"
|
| 构造器和说明 |
|---|
ResourceUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static File |
getFile(URL resourceUrl)
Resolve the given resource URL to a
java.io.File,
i.e. to a file in the file system. |
static File |
getFile(URL resourceUrl,
String description)
Resolve the given resource URL to a
java.io.File,
i.e. to a file in the file system. |
static URI |
toURI(String location)
Create a URI instance for the given location String,
replacing spaces with "%20" URI encoding first.
|
static URI |
toURI(URL url)
Create a URI instance for the given URL,
replacing spaces with "%20" URI encoding first.
|
public static File getFile(URL resourceUrl) throws FileNotFoundException
java.io.File,
i.e. to a file in the file system.resourceUrl - the resource URL to resolveFileNotFoundException - if the URL cannot be resolved to
a file in the file systempublic static File getFile(URL resourceUrl, String description) throws FileNotFoundException
java.io.File,
i.e. to a file in the file system.resourceUrl - the resource URL to resolvedescription - a description of the original resource that
the URL was created for (for example, a class path location)FileNotFoundException - if the URL cannot be resolved to
a file in the file systempublic static URI toURI(URL url) throws URISyntaxException
url - the URL to convert into a URI instanceURISyntaxException - if the URL wasn't a valid URIURL.toURI()public static URI toURI(String location) throws URISyntaxException
location - the location String to convert into a URI instanceURISyntaxException - if the location wasn't a valid URICopyright © 2019. All rights reserved.