Package com.iizix.util.memjar
Class Handler
- java.lang.Object
- java.net.URLStreamHandler
- com.iizix.util.memjar.Handler
- All Implemented Interfaces:
IJarURLStreamHandler
public class Handler extends java.net.URLStreamHandler implements IJarURLStreamHandler
The memory JarURLStreamHandler
.This class must be named
Handler
for the default system handler search mechanism to function. Normally you will not use this class directly;NpURLStreamHandlerFactory
documents how to globally install memjar support.- Author:
- Christopher Mindus
Field Summary
Fields Modifier and Type Field Description static boolean
DEBUG
Debug flag, default false.
Constructor Summary
Constructors Constructor Description Handler()
Construct a newHandler
.Handler(MemoryJarFile jarFile)
Handler construction for an open Memory Jar.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IJarFile
getJarFile()
Gets the IJarFile from the handler.protected java.net.URLConnection
openConnection(java.net.URL url)
Open anMemoryJarURLConnection
to the specified URL.
Constructor Detail
Handler
public Handler()
Construct a newHandler
.
Handler
public Handler(MemoryJarFile 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:
getJarFile
in interfaceIJarURLStreamHandler
- Returns:
- The Jar file, or
null
if handler did not specify an IJarFile.
openConnection
protected java.net.URLConnection openConnection(java.net.URL url) throws java.io.IOException
Open anMemoryJarURLConnection
to the specified URL.- Specified by:
openConnection
in classjava.net.URLStreamHandler
- Parameters:
url
- TheURL
to which to connect.- Throws:
java.io.IOException