Package com.networknt.schema.resource
Class UriSchemaLoader
- java.lang.Object
-
- com.networknt.schema.resource.UriSchemaLoader
-
- All Implemented Interfaces:
SchemaLoader
public class UriSchemaLoader extends java.lang.Object implements SchemaLoader
Loads from uri.
-
-
Constructor Summary
Constructors Constructor Description UriSchemaLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamSource
getSchema(AbsoluteIri absoluteIri)
Loads a schema given the retrieval IRI.protected java.io.InputStream
openConnectionCheckRedirects(java.net.URLConnection c)
protected java.net.URI
toURI(AbsoluteIri absoluteIri)
Converts an AbsoluteIRI to a URI.protected java.net.URL
toURL(java.net.URI uri)
Converts a URI to a URL.
-
-
-
Method Detail
-
getSchema
public InputStreamSource getSchema(AbsoluteIri absoluteIri)
Description copied from interface:SchemaLoader
Loads a schema given the retrieval IRI.- Specified by:
getSchema
in interfaceSchemaLoader
- Parameters:
absoluteIri
- the retrieval IRI- Returns:
- the input stream source
-
toURI
protected java.net.URI toURI(AbsoluteIri absoluteIri)
Converts an AbsoluteIRI to a URI.Internationalized domain names will be converted using java.net.IDN.toASCII.
- Parameters:
absoluteIri
- the absolute IRI- Returns:
- the URI
-
toURL
protected java.net.URL toURL(java.net.URI uri)
Converts a URI to a URL.This will throw if the URI is not a valid URL. For instance if the URI is not absolute.
- Parameters:
uri
- the URL- Returns:
- the URL
-
openConnectionCheckRedirects
protected java.io.InputStream openConnectionCheckRedirects(java.net.URLConnection c) throws java.io.IOException
- Throws:
java.io.IOException
-
-