|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.util.type.ResourceUtil
public final class ResourceUtil
The ResourceUtil contains resource and class
dependent utility methods.
| Method Summary | |
|---|---|
static boolean |
getAccessibleBoolean(String pName,
boolean pDefaultValue)
Gets the boolean value of a system property, if the property is accessible. |
static String |
getAccessibleProperty(String pName,
String pDefaultValue)
Gets the string value of a system property, if the property is accessible. |
static File |
getFileForClass(String pClassName)
Searches the file in which a class is stored. |
static String |
getFqClassName(Object pScope)
Returns the full qualified class name for an object. |
static String |
getLocationForClass(String pClassName)
Searches the location where a class is stored. |
static String |
getName(Class<?> pClass)
Gets the name of a class. |
static String |
getPackage(Class<?> pClass)
Gets the package name from a class independent of Class.getPackage(). |
static String |
getPathForClass(String pClassName)
Searches the directory where a class is stored. |
static InputStream |
getResourceAsStream(String pResource)
Finds a resource with a given name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static InputStream getResourceAsStream(String pResource)
pResource as absolute pathpResource, if it's an absolute path, and search
in the classes or lib directory where this util class is storedClassLoader
pResource - one of the following: /package/<classname>.class,
C:\temp\config.xml, /tmp/config.xml
null if no resource with this name is foundpublic static String getPathForClass(String pClassName)
pClassName - z.B.: /package/<class>.class
public static String getLocationForClass(String pClassName)
pClassName - z.B.: /package/<class>.class
public static File getFileForClass(String pClassName)
pClassName - z.B.: /package/<class>.class
public static String getFqClassName(Object pScope)
pScope - a class or object instance
public static String getName(Class<?> pClass)
pClass - class from which you want the name
public static String getAccessibleProperty(String pName,
String pDefaultValue)
pName - the name of the system propertypDefaultValue - the default value if the property is null
or is not accessible
null,
otherwise the pDefaultValue
public static boolean getAccessibleBoolean(String pName,
boolean pDefaultValue)
pName - the name of the system propertypDefaultValue - the default value if the property is null
or is not accessible
null,
otherwise the pDefaultValuepublic static String getPackage(Class<?> pClass)
Class.getPackage().
pClass - the loaded class
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||