|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.abstracthorizon.extend.server.support.ClassUtils
public class ClassUtils
Utility class that contains class and url tool methods.
Nested Class Summary | |
---|---|
static class |
ClassUtils.LocalURLClassLoader
|
Constructor Summary | |
---|---|
ClassUtils()
|
Method Summary | |
---|---|
static Collection<URL> |
collectFiles(URL url)
Collects files from given url. |
static Collection<URL> |
collectFilesFromJar(URL original,
JarFile jarFile)
Collects files from jar file (root of) |
static Collection<URL> |
collectFilesFromPath(File path)
Collects files from given path |
static Collection<URL> |
collectFilesFromURL(URL url)
Collects files from give (generic) url |
static URLClassLoader |
createClassLoader(ClassLoader parent,
URL lib)
Creates class loader for given url. |
static URL |
getHomeLocation(Class<?> cls)
Gets home location. |
static void |
invokeMethod(Object object,
String methodName,
boolean mustBePresent)
Invokes parametherless method with given name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassUtils()
Method Detail |
---|
public static void invokeMethod(Object object, String methodName, boolean mustBePresent)
mustBePresent
is set to true
NoSuchMethodException
is propagated wrapped in
RuntimeException
.
object
- instance on which method is going to be executedmethodName
- method namemustBePresent
- if set then method must be present or NoSuchMethodError
is thrown
RuntimeException
- if NoSuchMethodException
, IllegalArgumentException
,
IllegalAccessException
or InvocationTargetException
is thrown.public static URLClassLoader createClassLoader(ClassLoader parent, URL lib)
parent
- parent class loader or null
lib
- url class loader to be created for.
ClassUtils.LocalURLClassLoader
instancepublic static Collection<URL> collectFiles(URL url) throws IOException
url
- url
IOException
public static Collection<URL> collectFilesFromPath(File path) throws IOException
path
- directory
IOException
public static Collection<URL> collectFilesFromJar(URL original, JarFile jarFile) throws IOException
original
- original urljarFile
- jar file
IOException
public static Collection<URL> collectFilesFromURL(URL url) throws IOException
url
- url
IOException
public static URL getHomeLocation(Class<?> cls) throws MalformedURLException
MalformedURLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |