|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.lsst.ccs.utilities.jars.CommonResources
public class CommonResources
This class deals with "common resources": that is resources that are not linked to a specific package (such resources are often queried using an initial slash when querying a resource through the Class resource methods such as getResource : getResource("/global.properties")).
Beware: in the codeusing this class these resource names should not start with a slash (same protocol as with the ClassLoader resource methods. The general idea is that when dealing with multiple jars there may be many "common resources" with the same name.
| Field Summary | |
|---|---|
static URL[] |
URL_ARRAY_MODEL
|
| Constructor Summary | |
|---|---|
CommonResources()
|
|
| Method Summary | |
|---|---|
static String[] |
getClassURLNamesFor(Object obj)
get the names of places where a Class lies in the classPath |
static Manifest |
getManifestFor(Object obj)
returns a Manifest for an object |
static Properties |
getPropertiesFrom(URL url)
fills a Property Object from an URL the references a file in ".properties" format |
static String |
getResourceContainer(URL url,
String commonResourceName)
gets the name of a jar that contains a "common resource" |
static URL[] |
getURLsFor(Object obj,
String commonResourceName)
return the URL of a resource that lies in the same jar as a class. |
static URL[] |
getURLsFrom(ClassLoader loader,
String commonResourceName)
As "seen" from a ClassLoader the various URLs that point to resources with a given name |
static URL[] |
getURLsFrom(String commonResourceName)
As "seen" from the context ClassLoader the various URLs that point to resources with a given name |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final URL[] URL_ARRAY_MODEL
| Constructor Detail |
|---|
public CommonResources()
| Method Detail |
|---|
public static URL[] getURLsFrom(ClassLoader loader,
String commonResourceName)
loader - a current ClassLoadercommonResourceName - name of resource (without initial slash!)
public static URL[] getURLsFrom(String commonResourceName)
commonResourceName - name of resource (without initial slash!)
public static URL[] getURLsFor(Object obj,
String commonResourceName)
obj - any instance of a Class object if no instance is at handcommonResourceName - name of resource (without initial slash!)
public static String[] getClassURLNamesFor(Object obj)
obj - any object or Class
public static Properties getPropertiesFrom(URL url)
url -
public static String getResourceContainer(URL url,
String commonResourceName)
url - commonResourceName - name of resource (without initial slash!)
public static Manifest getManifestFor(Object obj)
obj - an object instance or a Class
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||