public class ResourceLoader extends InitialContextImpl implements Serializable, Context
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG |
CONTEXT_ID, env, LOAD_CONTEXTAPPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES| Constructor and Description |
|---|
ResourceLoader() |
ResourceLoader(String s)
Constructor which takes a path to the properties file containing the initial
ResourceLoader values.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addFileToJar(String jarandResource,
String f)
write file f to jar referenced by jarandresource (
|
static String |
Decode(String s)
Decode a URL String, if supported by the JDK version in use this method will
utilize the
|
static String |
Decode(String s,
String encoding)
Decode a URL String, if supported by the JDK version in use this method will
utilize the non-deprecated method of decoding.
|
static Object |
execute(Object ob,
Object[] args,
String methname)
Execute a Method on an Object
|
static Object |
executeIfSupported(Object ob,
Object[] args,
String methname)
Attempt to execute a Method on an Object
|
static String[] |
extractJarAndResourceName(String jarAndResource)
separate and return the jar portion and resource portion of a jar and
resource string:
|
static byte[] |
getBytesFromJar(String name)
Loads the named resource from the class path.
|
static String |
getFilePathForResource(String resource)
Returns the file system-specific path to a given resource in the classpath
for the VM.
|
Enumeration |
getKeys() |
Object |
getObject(String key) |
Object[] |
getObjects(String propname)
Returns an Array of Objects which are class loaded based on a comma-delimited
list of class names listed in the properties file.
|
String |
getResourceString(String nm)
Returns a String from the properties file
|
static String |
getVersion() |
static String |
getWorkingDirectoryFromJar(String resource)
Get the path to a directory by locating the jar file in the classpath
containing the given resource name.
|
static boolean |
isJarFile(String f)
returns truth of "file is a jar/archive file"
|
static Object |
loadClass(String className)
Load a Class by name
|
void |
setDebug(boolean b)
Sets the debugging level for the ResourceLoader
|
void |
setResourceString(String nm,
String v)
Sets a String value in the properties file
|
String |
toString() |
addToEnvironment, bind, bind, close, composeName, composeName, createSubcontext, createSubcontext, destroySubcontext, destroySubcontext, getEnvironment, getNameInNamespace, getNameParser, getNameParser, list, list, listBindings, listBindings, lookup, lookup, lookupLink, lookupLink, rebind, rebind, removeFromEnvironment, rename, rename, unbind, unbindclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddToEnvironment, bind, bind, close, composeName, composeName, createSubcontext, createSubcontext, destroySubcontext, destroySubcontext, getEnvironment, getNameInNamespace, getNameParser, getNameParser, list, list, listBindings, listBindings, lookup, lookup, lookupLink, lookupLink, rebind, rebind, removeFromEnvironment, rename, rename, unbind, unbindpublic ResourceLoader(String s)
s - public ResourceLoader()
public static String getVersion()
public Enumeration getKeys()
public String getResourceString(String nm)
nm - public void setResourceString(String nm, String v)
nm - public Object[] getObjects(String propname)
public static Object loadClass(String className)
className - public static byte[] getBytesFromJar(String name) throws IOException
IOExceptionpublic static String getFilePathForResource(String resource)
resource - public static void addFileToJar(String jarandResource, String f)
jarandResource - f - public static boolean isJarFile(String f)
f - public static String[] extractJarAndResourceName(String jarAndResource)
jarAndResource - public static String getWorkingDirectoryFromJar(String resource)
resource - public static String Decode(String s)
s - public static String Decode(String s, String encoding)
s, - string to decodeencoding, - the encoding type to usepublic static Object executeIfSupported(Object ob, Object[] args, String methname)
ob - the Object which contains the method you want to executeargs - an array of arguments to the Method, null if nonemethname - the name of the Method you are executingpublic static Object execute(Object ob, Object[] args, String methname) throws Exception
ob - the Object which contains the method you want to executeargs - an array of arguments to the Method, null if nonemethname - the name of the Method you are executingExceptionpublic void setDebug(boolean b)
b - Copyright © 2002–2019 Starter Inc.. All rights reserved.