|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ocltf.utils.FileResourceUtils
Provides utilities for loading resources using ClassLoaders.
Constructor Summary | |
FileResourceUtils()
|
Method Summary | |
static java.net.URL |
getClassResource(java.lang.Class clazz)
Takes a Class as an argument and returns the URL for the class. |
static java.net.URL |
getClassResource(java.lang.String className)
Takes a className as an argument and returns the URL for the class. |
static java.net.URL |
getPackageResource(java.lang.Class clazz)
Takes a package as an argument and returns the URL for the package. |
static java.net.URL |
getPackageResource(java.lang.String packageName)
Takes a packageName |
static java.net.URL |
getResource(java.lang.String resourceName)
Retrieves aresource from the class package |
static java.lang.String |
getResourceContentsAsString(java.lang.String resourceName)
Loads the file resource and returns the contents as a String. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileResourceUtils()
Method Detail |
public static java.net.URL getResource(java.lang.String resourceName)
resourceName
- - the name of the resource
public static java.net.URL getPackageResource(java.lang.Class clazz)
clazz
- - the Class to load as a resource
public static java.net.URL getClassResource(java.lang.Class clazz)
clazz
- - the Class to load as a resource
public static java.net.URL getClassResource(java.lang.String className)
className
-
public static java.net.URL getPackageResource(java.lang.String packageName)
packageName as an argument and returns the URL for the
class.
- Parameters:
packageName
-
- Returns:
- java.net.URL
public static java.lang.String getResourceContentsAsString(java.lang.String resourceName)
resourceName
- the name of the resource.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |