public class URLFactory extends Object
URL
's. This factory creates URL
's that in additional to the standard URL
's
capability of loading resources using http, https, file, etc. also makes it possible to load resources from
the applications classpath. To load a resource from classpath, the url must be prefixed either with classpath:
or resource:
To ensure that we support classpath resources, this class should be used instead of new URL(pURL)
Constructor and Description |
---|
URLFactory() |
public static URL toURL(URL parentUrl, String url) throws MalformedURLException
URL
based on the provided string and parent url.parentUrl
- the parent URL of the given url (if no parent exists, then this can be null).url
- the urlURL
MalformedURLException
- if the url is not a proper URLpublic static URL toURL(String url) throws MalformedURLException
URL
based on the provided stringurl
- the urlURL
MalformedURLException
- if the url is not a proper URLCopyright © 2019. All rights reserved.