Class AbstractDigger

java.lang.Object
clazzfish.monitor.internal.AbstractDigger
Direct Known Subclasses:
ClasspathDigger

public abstract class AbstractDigger extends Object
The Class AbstractDigger was extracted from ClasspathDigger and ResourcepathDigger. It is intended to pull up common code of both classes into this class to avoid code duplicates.

For later it is planned to derive ClasspathDigger from ResourepathDigger (the other way around at now), because a class can be considered as specialized resource (resource with suffix ".class").

Originally this class was part of the PatternTesting project.

Author:
oboehm
  • Constructor Details

    • AbstractDigger

      public AbstractDigger()
  • Method Details

    • getResources

      public abstract Enumeration<URI> getResources(String name)
      Gets the resources of the given name. Normally that would only be one element but some resources (like the MANIFEST.MF file) can appear several times in the classpath.
      Parameters:
      name - the name of the resource
      Returns:
      all resources with the given name
    • readElementsFromNestedArchive

      protected static Collection<String> readElementsFromNestedArchive(File archive) throws IOException
      Read elements from nested archive.
      Parameters:
      archive - a JAR, WAR or EAR archive
      Returns:
      the digged resources
      Throws:
      IOException - Signals that an I/O exception has occurred.