org.apache.maven.util
Class ResourceBean

java.lang.Object
  extended byorg.apache.maven.util.ResourceBean

public class ResourceBean
extends java.lang.Object

A helper bean to load the given URI from the current threads class loader or the class loader that was used to load this class.

Author:
James Strachan

Constructor Summary
ResourceBean()
           
 
Method Summary
 java.net.URL findResource(java.lang.String name)
          Attempts to load the given resource from the given name.
 java.lang.ClassLoader getClassLoader()
          Returns the classLoader.
 void setClassLoader(java.lang.ClassLoader classLoader)
          Sets the classLoader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceBean

public ResourceBean()
Method Detail

findResource

public java.net.URL findResource(java.lang.String name)
Attempts to load the given resource from the given name. The current thrad context class loader will be tried first, then the class loader used to load this class. If the classLoader property on this bean is set then that ClassLoader is used in preference to any other.

Parameters:
name - of the resource to load
Returns:
URL of the resource or null if could not be found

getClassLoader

public java.lang.ClassLoader getClassLoader()
Returns the classLoader.

Returns:
ClassLoader

setClassLoader

public void setClassLoader(java.lang.ClassLoader classLoader)
Sets the classLoader.

Parameters:
classLoader - The classLoader to set


Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.