org.backsource.utils.resource
Class ClassContextURLFactory

java.lang.Object
  extended byorg.backsource.utils.resource.ClassContextURLFactory
All Implemented Interfaces:
URLFactory

public class ClassContextURLFactory
extends java.lang.Object
implements URLFactory

An URL factory which translates the URI into a resource available in the classpath.

This might be registered to lookup URI:s as resources in the classpath. Currently the URI.getPath() is used to get at the resource name.

Resources is looked up in the current context class loader.

Version:
$Revision: 1.1.1.1 $
Author:
Peter Antman

Constructor Summary
ClassContextURLFactory()
           
 
Method Summary
protected  java.lang.String getResURI(URI uri)
           
 java.net.URL getURL(URI uri)
          Construct an URL from URI by looking it up in the ContextClassLoader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassContextURLFactory

public ClassContextURLFactory()
Method Detail

getURL

public java.net.URL getURL(URI uri)
                    throws java.net.MalformedURLException
Construct an URL from URI by looking it up in the ContextClassLoader.

Specified by:
getURL in interface URLFactory
Throws:
java.net.MalformedURLException

getResURI

protected java.lang.String getResURI(URI uri)


Copyright © 2000-2004 Backsource. All Rights Reserved.