Package com.iizix.util.xjar
Class Handler
java.lang.Object
java.net.URLStreamHandler
com.iizix.util.xjar.Handler
- All Implemented Interfaces:
IJarURLStreamHandler
The XJar
URLStreamHandler
.This class must be named Handler
for the default system handler search mechanism to function. Normally you will not use this class directly; XURLStreamHandlerFactory
documents how to globally install Xjar support. However, you can employ XJar using just this class:
Handler xjar = new Handler(...); URL url = new URL (..., xjar);
- Author:
- Christopher Mindus
Field Summary
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionGets the IJarFile from the handler.protected URLConnection
openConnection
(URL url) Open anXJarURLConnection
to the specified URL.Methods inherited from class java.net.URLStreamHandler
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, openConnection, parseURL, sameFile, setURL, setURL, toExternalForm
Field Details
DEBUG
public static boolean DEBUGDebug flag, default false.
Constructor Details
Handler
public Handler()Construct a newHandler
.Handler
Handler construction for an open Memory Jar.- Parameters:
jarFile
- The Jar file to use.
Method Details
getJarFile
Gets the IJarFile from the handler.- Specified by:
getJarFile
in interfaceIJarURLStreamHandler
- Returns:
- The Jar file, or
null
if handler did not specify an IJarFile.
openConnection
Open anXJarURLConnection
to the specified URL.- Specified by:
openConnection
in classURLStreamHandler
- Parameters:
url
- TheURL
to which to connect.- Throws:
IOException