Package net.sourceforge.jnlp.runtime
Class CachedJarFileCallback
- java.lang.Object
-
- net.sourceforge.jnlp.runtime.CachedJarFileCallback
-
public final class CachedJarFileCallback extends java.lang.ObjectInvoked by URLJarFile to get a JarFile corresponding to a URL. Large parts of this class are based on JarFileFactory and URLJarFile. Hooked in reflectively: sun.net.www.protocol.jar.URLJarFileCallBack is gone in newer JDKs.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateCachedJarFileCallback()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMapping(java.net.URL remoteUrl, java.net.URL localUrl)private java.util.jar.JarFilecacheJarFile(java.net.URL url)static CachedJarFileCallbackgetInstance()static voidregister()Registers this as URLJarFile callback.java.util.jar.JarFileretrieve(java.net.URL url)
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
INSTANCE
private static final CachedJarFileCallback INSTANCE
-
mapping
private final java.util.Map<UrlKey,java.net.URL> mapping
-
-
Method Detail
-
getInstance
public static CachedJarFileCallback getInstance()
-
addMapping
public void addMapping(java.net.URL remoteUrl, java.net.URL localUrl)
-
register
public static void register()
Registers this as URLJarFile callback. No-op on JDKs without URLJarFileCallBack; remote jar: URLs are then fetched by the JDK itself, bypassing the ITW cache.
-
retrieve
public java.util.jar.JarFile retrieve(java.net.URL url) throws java.io.IOException- Throws:
java.io.IOException
-
cacheJarFile
private java.util.jar.JarFile cacheJarFile(java.net.URL url) throws java.io.IOException- Throws:
java.io.IOException
-
-