Package org.opennms.core.utils.url
Class GenericURLStreamHandler
- java.lang.Object
-
- java.net.URLStreamHandler
-
- org.opennms.core.utils.url.GenericURLStreamHandler
-
public class GenericURLStreamHandler extends URLStreamHandler
GenericURLStreamHandler class.
Customized URL stream handler creates dynamically created URL connections from customized URL protocols.- Author:
- Christian Pape, Ronny Trommer
-
-
Constructor Summary
Constructors Constructor Description GenericURLStreamHandler(Class<? extends URLConnection> urlConnectionClass)GenericURLStreamHandlerGenericURLStreamHandler(Class<? extends URLConnection> urlConnectionClass, int defaultPort)GenericURLStreamHandler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intgetDefaultPort()protected URLConnectionopenConnection(URL u)-
Methods inherited from class java.net.URLStreamHandler
equals, getHostAddress, hashCode, hostsEqual, openConnection, parseURL, sameFile, setURL, setURL, toExternalForm
-
-
-
-
Constructor Detail
-
GenericURLStreamHandler
public GenericURLStreamHandler(Class<? extends URLConnection> urlConnectionClass, int defaultPort)
GenericURLStreamHandler
Create URL stream handler with given class and customized default port.
-
GenericURLStreamHandler
public GenericURLStreamHandler(Class<? extends URLConnection> urlConnectionClass)
GenericURLStreamHandler
Create URL stream handler with given class and default port -1.- Parameters:
urlConnectionClass- full qualified classname asStringobject.
-
-
Method Detail
-
getDefaultPort
protected int getDefaultPort()
- Overrides:
getDefaultPortin classURLStreamHandler
-
openConnection
protected URLConnection openConnection(URL u) throws IOException
- Specified by:
openConnectionin classURLStreamHandler- Throws:
IOException
-
-