Class URLClassPathRepository

java.lang.Object
edu.umd.cs.findbugs.ba.URLClassPathRepository
All Implemented Interfaces:
org.apache.bcel.util.Repository

public class URLClassPathRepository extends Object implements org.apache.bcel.util.Repository
BCEL Repository implementation that uses an URLClassPath to find classes. This class has two specific improvements over BCEL's SyntheticRepository class:
  1. Classpath elements may be added at any time, not just when the object is created.
  2. Classpath elements can be URLs. This allows repository lookups to find classes via http URLs, jar URLs, etc.
FindBugs requires and uses both of these capabilities.
Author:
David Hovemeyer
  • Field Details

    • DEBUG

      public static final boolean DEBUG
  • Constructor Details

    • URLClassPathRepository

      public URLClassPathRepository()
  • Method Details

    • destroy

      public void destroy()
      Clear the repository and close all underlying resources.
    • addURL

      public void addURL(String fileName) throws IOException
      Add a filename or URL to the classpath.
      Parameters:
      fileName - filename or URL of classpath entry to add
      Throws:
      IOException
    • storeClass

      public void storeClass(org.apache.bcel.classfile.JavaClass javaClass)
      Specified by:
      storeClass in interface org.apache.bcel.util.Repository
    • removeClass

      public void removeClass(org.apache.bcel.classfile.JavaClass javaClass)
      Specified by:
      removeClass in interface org.apache.bcel.util.Repository
    • findClass

      public org.apache.bcel.classfile.JavaClass findClass(String className)
      Specified by:
      findClass in interface org.apache.bcel.util.Repository
    • loadClass

      public org.apache.bcel.classfile.JavaClass loadClass(String className) throws ClassNotFoundException
      Specified by:
      loadClass in interface org.apache.bcel.util.Repository
      Throws:
      ClassNotFoundException
    • loadClass

      public org.apache.bcel.classfile.JavaClass loadClass(Class<?> clazz) throws ClassNotFoundException
      Specified by:
      loadClass in interface org.apache.bcel.util.Repository
      Throws:
      ClassNotFoundException
    • clear

      public void clear()
      Specified by:
      clear in interface org.apache.bcel.util.Repository
    • getClassPath

      public org.apache.bcel.util.ClassPath getClassPath()
      Specified by:
      getClassPath in interface org.apache.bcel.util.Repository