|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.util.ClassUtilities
public class ClassUtilities
A collection of utilities for manipulating classes. These utilities do not depend on any other ptolemy.* packages.
Green (cxh) |
Green (cxh) |
Method Summary | |
---|---|
static java.net.URL |
jarURLEntryResource(java.lang.String jarURLString)
Lookup a jar URL and return the resource. |
static java.lang.String |
lookupClassAsResource(java.lang.String necessaryClass)
Given a dot separated classname, return the jar file or directory where the class can be found. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.net.URL jarURLEntryResource(java.lang.String jarURLString) throws java.io.IOException
file://./foo.jar!/a/b/c.class
is a jar URL that
refers to the a/b/c.class
resource in
foo.jar
. If this method is called with
file://./foo.jar!/a/b/c.class
then it will return
a/b/c.class
if a/b/c.class
can be
found as a resource in the class loader that loaded this class
(ptolemy.util.ClassUtilities). If the resource cannot be found,
then an IOException is thrown. If the jarURLString parameter
does not contain !/
, then return null.
Note that everything before the !/
is removed before
searching the classpath.
This method is necessary because Web Start uses jar URL, and there are some cases where if we have a jar URL, then we may need to strip off the jar:url!/ part so that we can search for the {entry} as a resource.
jarURLString
- The string containing the jar URL.
!/
, then return null.
java.io.IOException
- If this method cannot convert the specification
to a URL.JarURLConnection
public static java.lang.String lookupClassAsResource(java.lang.String necessaryClass)
necessaryClass
- The dot separated class name, for example
"ptolemy.util.ClassUtilities"
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |