Top Description Fields Constructors Methods
com.sun.webkit.network

public final Class URLs

extends Object
Class Inheritance
Imports
java.net.MalformedURLException, .URL, .URLStreamHandler, java.util.Map

A collection of static methods for URL creation.

Field Summary

Modifier and TypeField and Description
private static final Map<String, URLStreamHandler>
HANDLER_MAP

The mapping between WebPane-specific protocol names and their respective handlers.

Constructor Summary

AccessConstructor and Description
private
URLs()

The private default constructor.

Method Summary

Modifier and TypeMethod and Description
public static URL
newURL(String
the String to parse as a URL.
spec
)

Creates a URL object from the String representation.

public static URL
newURL(final URL
the context in which to parse the specification.
context
,
final String
the String to parse as a URL.
spec
)

Creates a URL by parsing the given spec within a specified context.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

HANDLER_MAPback to summary
private static final Map<String, URLStreamHandler> HANDLER_MAP

The mapping between WebPane-specific protocol names and their respective handlers.

Constructor Detail

URLsback to summary
private URLs()

The private default constructor. Ensures non-instantiability.

Method Detail

newURLback to summary
public static URL newURL(String spec) throws MalformedURLException

Creates a URL object from the String representation. This method is equivalent to the URL#URL(String) constructor with the additional support for WebPane-specific protocol handlers.

Parameters
spec:String

the String to parse as a URL.

Exceptions
MalformedURLException:
if the string specifies an unknown protocol.
newURLback to summary
public static URL newURL(final URL context, final String spec) throws MalformedURLException

Creates a URL by parsing the given spec within a specified context. This method is equivalent to the URL#URL(URL, String) constructor with the additional support for WebPane-specific protocol handlers.

Parameters
context:URL

the context in which to parse the specification.

spec:String

the String to parse as a URL.

Exceptions
MalformedURLException:
if no protocol is specified, or an unknown protocol is found.