public class Handler extends URLStreamHandler
This is class allows you to use the njar: URL protocol. It is very similar to it's jar: cusin. The difference being that jars can be nested.
An example of how to use this class is:
URL url = new URL("njar:njar:file:c:/test1.zip^/test2.zip^/hello.txt"); url.openStream();
Please be aware that the njar protocol caches it's jar in temporary storage when connections are opened into them. So for the above example, 2 files would cached a temp files names similar to nested-xxxx.jar
Modifier and Type | Field and Description |
---|---|
static String |
JAR_SEPARATOR |
static String |
NJAR_SEPARATOR |
static String |
PROTOCOL |
protected Map |
savedJars |
Constructor and Description |
---|
Handler() |
Modifier and Type | Method and Description |
---|---|
static URL |
njarToFile(URL url) |
URLConnection |
openConnection(URL url) |
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, openConnection, parseURL, sameFile, setURL, setURL, toExternalForm
public static final String PROTOCOL
public static final String NJAR_SEPARATOR
public static final String JAR_SEPARATOR
protected Map savedJars
public URLConnection openConnection(URL url) throws IOException
openConnection
in class URLStreamHandler
IOException
Copyright © 2018 JBoss by Red Hat. All rights reserved.