Class ClasspathResourceManager

java.lang.Object
org.codehaus.groovy.tools.groovydoc.ClasspathResourceManager
All Implemented Interfaces:
ResourceManager

public class ClasspathResourceManager extends Object implements ResourceManager
Loads documentation resources from the classpath.
  • Constructor Details

    • ClasspathResourceManager

      public ClasspathResourceManager()
      Creates a resource manager backed by this class's class loader.
    • ClasspathResourceManager

      public ClasspathResourceManager(ClassLoader classLoader)
      Creates a resource manager backed by the supplied class loader.
      Parameters:
      classLoader - the class loader to use for resource lookups
  • Method Details

    • getInputStream

      public InputStream getInputStream(String resourceName)
      Opens the named resource as an input stream.
      Parameters:
      resourceName - the classpath resource to load
      Returns:
      the resource stream, or null if the resource does not exist
    • getReader

      public Reader getReader(String resourceName) throws IOException
      Returns a reader for the named resource.
      Specified by:
      getReader in interface ResourceManager
      Parameters:
      resourceName - the resource to open
      Returns:
      a reader for the resource
      Throws:
      IOException - if the resource cannot be opened