Package com.networknt.schema.url
Class URLFactory
- java.lang.Object
-
- com.networknt.schema.url.URLFactory
-
public class URLFactory extends Object
A factory for creatingURL
's. This factory createsURL
's that in additional to the standardURL
'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 ofnew URL(pURL)
- Author:
- Kenneth Waldenstrom
-
-
Constructor Summary
Constructors Constructor Description URLFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static URL
toURL(String pURL)
Creates anURL
based on the provided string
-
-
-
Method Detail
-
toURL
public static URL toURL(String pURL) throws MalformedURLException
Creates anURL
based on the provided string- Parameters:
pURL
- the url- Returns:
- a
URL
- Throws:
MalformedURLException
- if the url is not a proper URL
-
-