org.jopendocument.util.protocol
Class Helper

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

public class Helper
extends Object


Constructor Summary
Helper()
           
 
Method Summary
static void register()
           
static void setURLStreamHandlerFactory()
          Set the factory to add our protocols.
static URL toJarJar(URL u)
          Wrap the passed URL into a jarjar one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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 URL toJarJar(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!/".


Copyright © 2010 jOpenDocument All Rights Reserved.