org.ow2.jonas.lib.loader.factory
Class JarURLFactory

java.lang.Object
  extended by org.ow2.jonas.lib.loader.factory.URLFactory
      extended by org.ow2.jonas.lib.loader.factory.JarURLFactory

public class JarURLFactory
extends URLFactory

A JarURLFactory is used to create URLs from a JarURL (jar:XXX) and paths. Example :
base : file:lib.jar
path : META-INF/directory/
results : jar:file:lib.jar!/META-INF/directory/

Author:
Guillaume Sauthier

Constructor Summary
JarURLFactory(URL url)
          Create a new JarURLFactory using the specified base URL.
 
Method Summary
 URL getURL(String path)
          Returns a new URL basically adding path to the base URL.
 
Methods inherited from class org.ow2.jonas.lib.loader.factory.URLFactory
getFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JarURLFactory

public JarURLFactory(URL url)
Create a new JarURLFactory using the specified base URL.

Parameters:
url - the base url. (must be a Jar archive)
Method Detail

getURL

public URL getURL(String path)
           throws IOException
Returns a new URL basically adding path to the base URL. returns the base URL when "" is used as parameter.

Specified by:
getURL in class URLFactory
Parameters:
path - the path to add to the URL. (must not start with "/")
Returns:
a new URL of the form jar:!/.
Throws:
IOException - when created URL is invalid.


Copyright © 2010 OW2 Consortium. All Rights Reserved.