org.objectweb.jonas_lib.loader.factory
Class URLFactory

java.lang.Object
  extended by org.objectweb.jonas_lib.loader.factory.URLFactory
Direct Known Subclasses:
DirURLFactory, JarURLFactory

public abstract class URLFactory
extends java.lang.Object

An URLFactory is used to create a URL from a base URL.

Author:
Guillaume Sauthier

Constructor Summary
URLFactory()
           
 
Method Summary
static URLFactory getFactory(java.net.URL url)
          Return a new URLFactory in function of the URL type.
abstract  java.net.URL getURL(java.lang.String path)
          Returns a new URL basically adding path to the base URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLFactory

public URLFactory()
Method Detail

getURL

public abstract java.net.URL getURL(java.lang.String path)
                             throws java.io.IOException
Returns a new URL basically adding path to the base URL.

Parameters:
path - the path to add to the URL.
Returns:
a new URL.
Throws:
java.io.IOException - when created URL is invalid.

getFactory

public static URLFactory getFactory(java.net.URL url)
                             throws java.io.IOException
Return a new URLFactory in function of the URL type. an URL pointing to a jar file will return a JarURLFactory and an URL pointing to a directory file will return a DirURLFactory.

Parameters:
url - the base URL
Returns:
a new URLFactory in function of the URL type.
Throws:
java.io.IOException - when cannot find a specialized factory for the given URL.