org.jopendocument.util.protocol
Class Helper

java.lang.Object
  extended by org.jopendocument.util.protocol.Helper

public class Helper
extends java.lang.Object


Constructor Summary
Helper()
           
 
Method Summary
static void register()
           
static void setURLStreamHandlerFactory()
          Set the factory to add our protocols.
static java.net.URL toJarJar(java.net.URL u)
          Wrap the passed URL into a jarjar one.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Helper

public Helper()
Method Detail

register

public static final void register()

setURLStreamHandlerFactory

public static final void setURLStreamHandlerFactory()
Set the factory to add our protocols. This is needed for example in web start when one of our url is embedded into a library supplied one. E.g. "jar:jarjar:file:/C:/mylibs/Outer.jar^/Inner.jar!/" will cause the jar Handler to try to create a jarjar URL but its classloader cannot access our classes (loaded by JNLPClassLoader).


toJarJar

public static final java.net.URL toJarJar(java.net.URL u)
Wrap the passed URL into a jarjar one. Needed since the jre cannot read files inside a jar inside a jar.

Parameters:
u - the URL to wrap, e.g. "jar:file:/C:/mylibs/Outer.jar!/Inner.jar".
Returns:
the wrapped URL, if necessary, i.e. if u references a jar in a jar, e.g. "jar:jarjar:file:/C:/mylibs/Outer.jar^/Inner.jar!/".