Package com.iizix.util.xjar
Class Handler
- java.lang.Object
- java.net.URLStreamHandler
- com.iizix.util.xjar.Handler
- All Implemented Interfaces:
IJarURLStreamHandler
public class Handler extends java.net.URLStreamHandler implements IJarURLStreamHandler
The XJarURLStreamHandler.This class must be named
Handlerfor the default system handler search mechanism to function. Normally you will not use this class directly;XURLStreamHandlerFactorydocuments 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
Fields Modifier and Type Field Description static booleanDEBUGDebug flag, default false.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IJarFilegetJarFile()Gets the IJarFile from the handler.protected java.net.URLConnectionopenConnection(java.net.URL url)Open anXJarURLConnectionto the specified URL.
Constructor Detail
Handler
public Handler()
Construct a newHandler.
Handler
public Handler(XJarFile jarFile)
Handler construction for an open Memory Jar.- Parameters:
jarFile- The Jar file to use.
Method Detail
getJarFile
public IJarFile getJarFile()
Gets the IJarFile from the handler.- Specified by:
getJarFilein interfaceIJarURLStreamHandler- Returns:
- The Jar file, or
nullif handler did not specify an IJarFile.
openConnection
protected java.net.URLConnection openConnection(java.net.URL url) throws java.io.IOExceptionOpen anXJarURLConnectionto the specified URL.- Specified by:
openConnectionin classjava.net.URLStreamHandler- Parameters:
url- TheURLto which to connect.- Throws:
java.io.IOException