Class ResourcepathDigger
java.lang.Object
clazzfish.core.Digger
clazzfish.monitor.internal.ClasspathDigger
clazzfish.monitor.internal.ResourcepathDigger
This is the sister of the
ClasspathDigger. It digs into the
classpath to find resources and resource problems.- Since:
- 1.7.2 (26.05.2017)
- Version:
- $Revision: 1.5 $
- Author:
- oboehm
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new digger for resources.ResourcepathDigger(ClassLoader cloader) Instantiates a new digger for resources. -
Method Summary
Modifier and TypeMethodDescriptionDigs into the classpath and returns the found resources.static URIwhichResource(String name, ClassLoader cloader) Returns the URI of the given resource and the given classloader.Methods inherited from class ClasspathDigger
getBootClasspath, getClassLoader, getClasspath, getClasspathFromPackages, getLoadedClasses, getLoadedClassnames, getLoadedPackageArray, getLoadedResources, getPackageArray, getResourcepathSet, getResources, isAgentAvailable, isClassloaderSupported, isLoaded, toString, whichResourceModifier and TypeMethodDescriptionString[]To get the boot classpath the sytem property "sun.boot.class.path" is used to get them.Gets the class loader.String[]We can use the system property "java.class.path" to get the classpath.protected String[]Here we use the loaded packages to calculate the classpath.Returns a list of classes which were loaded by the given classloader.String[]Asks the clazzfish agent for the loaded classnames.Package[]Returns the packages which were loaded by the classloader.Asks the classloader for the resources which it already loaded - either directly or because the corresponding package was already loaded.String[]Get all packages found in the classpath.getResourcepathSet(Collection<String> resources) Gets the resourcepathes which belongs to the given collection of resources.getResources(String name) Gets the resources of the given name.static booleanChecks if the ClasspathAgent is available as MBean.booleanChecks if is classloader supported.booleanChecks if the given classname is loaded.toString()Puts also the classloader in the toString representation.whichResource(String name) Returns the URI of the given resource and the given classloader.Methods inherited from class Digger
getClasses, getClassRecords, getShadedRecords, readElementsFromNestedArchive, resourceToClassModifier and TypeMethodDescriptionString[]Digs into the classpath and returns the found classes.Digs into the classpath and returns the found classes together with the URI of the classpath where the class belongs to.Shadowed classes are classes which are more than once in the classpath and which are shadowed by another class.static Collection<String> readElementsFromNestedArchive(File archive) Read elements from nested archive.static StringresourceToClass(String name) Converts a resource (e.g.
-
Field Details
-
DEFAULT
-
-
Constructor Details
-
ResourcepathDigger
public ResourcepathDigger()Instantiates a new digger for resources. -
ResourcepathDigger
Instantiates a new digger for resources.- Parameters:
cloader- the classloder used for digging
-
-
Method Details
-
getResources
-
whichResource
Returns the URI of the given resource and the given classloader. If the resource is not found it will be tried again with/without a leading "/" and with the parent classloader.- Parameters:
name- resource name (e.g. "log4j.properties")cloader- class loader- Returns:
- URI of the given resource (or null if resource was not found)
-