oemware.core.util
Class ClasspathUtils

java.lang.Object
  extended by oemware.core.util.ClasspathUtils

public final class ClasspathUtils
extends java.lang.Object

The classpath utils.

Version:
$Id: ClasspathUtils.java 13 2008-06-15 19:43:04Z oemware $

Constructor Summary
ClasspathUtils()
           
 
Method Summary
static java.net.URL loadResourceUrl(java.lang.String pName)
          Load a resource url.
static java.util.Properties loadXmlPropertes(java.lang.String pResourceName)
          Load properties from an xml config file in the path.
static java.io.InputStream openResourceUrl(java.lang.String pName)
          Open a resource url input stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClasspathUtils

public ClasspathUtils()
Method Detail

loadXmlPropertes

public static final java.util.Properties loadXmlPropertes(java.lang.String pResourceName)
                                                   throws CoreException
Load properties from an xml config file in the path.

Parameters:
pResourceName - The resource name.
Returns:
The properties object.
Throws:
CoreException

openResourceUrl

public static final java.io.InputStream openResourceUrl(java.lang.String pName)
                                                 throws CoreException
Open a resource url input stream. Look at the loadResourceUrl method for a description of how the resource is searched for.

Parameters:
pName - The resource name.
Returns:
The open input stream.
Throws:
CoreException

loadResourceUrl

public static final java.net.URL loadResourceUrl(java.lang.String pName)
                                          throws CoreException
Load a resource url. This looks at the current class loader first and if the resource isn't found it looks at the system class loader. If it's not found anywhere, an exception is thrown.

Parameters:
pName - The resource name.
Returns:
The resource url.
Throws:
CoreException


Copyright © 2008 Deft Labs - Released under LGPL, Version 3.0