|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jaulp.io.ResourceUtils
public class ResourceUtils
Utility class for the use Resource object.
Constructor Summary | |
---|---|
ResourceUtils()
|
Method Summary | ||
---|---|---|
static java.lang.ClassLoader |
getClassLoader(java.lang.Object obj)
Gets the ClassLoader from the given object. |
|
static java.lang.String |
getClassnameWithSuffix(java.lang.Object obj)
Gets the classname and concats the suffix ".class" from the object. |
|
static java.lang.String |
getPackagePath(java.lang.Object object)
Determines the package path from the given object. |
|
static java.lang.String |
getPackagePathWithSlash(java.lang.Object object)
Determines the package path from the given object and adds a slash at the front. |
|
static java.lang.String |
getPathFromObject(java.lang.Object obj)
Finds the absolute path from the object. |
|
static java.net.URL |
getResource(java.lang.String name)
Gives the URL from the resource. |
|
static
|
getResource(java.lang.String name,
T obj)
Gives the URL from the resource. |
|
static java.io.File |
getResourceAsFile(java.lang.String name,
java.lang.Object obj)
Gives the resource as a file. |
|
static java.io.InputStream |
getResourceAsStream(java.lang.String name)
Gives the Inputstream from the resource. |
|
static java.io.InputStream |
getResourceAsStream(java.lang.String name,
java.lang.Object obj)
Gives the Inputstream from the resource. |
|
static java.net.URL |
getRessource(java.lang.Class clazz,
java.lang.String path)
Gives the url from the path back. |
|
static java.io.InputStream |
getRessourceAsStream(java.lang.Class<?> clazz,
java.lang.String uri)
This method call the getResourceAsStream from the ClassLoader. |
|
static boolean |
isDerivate(java.lang.ClassLoader source,
java.lang.ClassLoader compare)
Compares the two given ClassLoader objects and returns true if compare is a derivate of source. |
|
static java.util.Properties |
loadProperties(java.lang.String packagePath)
Gives a Properties-object from the given packagepath. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceUtils()
Method Detail |
---|
public static java.lang.String getClassnameWithSuffix(java.lang.Object obj)
obj
- The object.
public static java.lang.String getPackagePath(java.lang.Object object)
object
- The object.
public static java.lang.String getPackagePathWithSlash(java.lang.Object object)
object
- The object.
public static java.lang.String getPathFromObject(java.lang.Object obj)
obj
- The object.
public static java.net.URL getResource(java.lang.String name)
name
- The name from the resource.
public static <T> java.net.URL getResource(java.lang.String name, T obj)
name
- The name from the resource.obj
- The Object.
public static java.io.File getResourceAsFile(java.lang.String name, java.lang.Object obj)
name
- The name from the file.obj
- The Object.
public static java.io.InputStream getResourceAsStream(java.lang.String name)
name
- The name from the resource.
public static java.io.InputStream getResourceAsStream(java.lang.String name, java.lang.Object obj)
name
- The name from the resource.obj
- The Object.
public static java.lang.ClassLoader getClassLoader(java.lang.Object obj)
obj
- The object.
public static boolean isDerivate(java.lang.ClassLoader source, java.lang.ClassLoader compare)
source
- the sourcecompare
- the compare
public static java.net.URL getRessource(java.lang.Class clazz, java.lang.String path)
clazz
- The class-object.path
- The path.
public static java.io.InputStream getRessourceAsStream(java.lang.Class<?> clazz, java.lang.String uri)
uri
- The uri as String.
public static java.util.Properties loadProperties(java.lang.String packagePath)
packagePath
- The package-path and the name from the resource as a String.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |