public interface URLConverter
Clients may implement this interface.
Modifier and Type | Method and Description |
---|---|
URL |
resolve(URL url)
Converts a URL that uses a client-defined protocol into a URL that uses a
protocol which is native to the Java class library (file, jar, http, etc).
|
URL |
toFileURL(URL url)
Converts a URL that uses a user-defined protocol into a URL that uses the file
protocol.
|
URL toFileURL(URL url) throws IOException
If the protocol for the given URL is not recognized by this converter, the original URL is returned as-is.
url
- the original URLIOException
- if an error occurs during the conversionURL resolve(URL url) throws IOException
Note however that users of this API should not assume too much about the results of this method. While it may consistently return a file: URL in certain installation configurations, others may result in jar: or http: URLs.
If the protocol is not recognized by this converter, then the original URL is returned as-is.
url
- the original URLIOException
- if unable to resolve URLIOException
- if an error occurs during the resolutionCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.