Class SingleFileCodeBase

java.lang.Object
edu.umd.cs.findbugs.classfile.impl.SingleFileCodeBase
All Implemented Interfaces:
ICodeBase, IScannableCodeBase, AutoCloseable

public class SingleFileCodeBase extends Object implements IScannableCodeBase
Implementation of ICodeBase for a single classfile.
Author:
David Hovemeyer
  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getCodeBaseLocator

      public ICodeBaseLocator getCodeBaseLocator()
      Description copied from interface: ICodeBase
      Get the codebase locator describing the location of this codebase.
      Specified by:
      getCodeBaseLocator in interface ICodeBase
      Returns:
      the ICodeBaseLocator
    • containsSourceFiles

      public boolean containsSourceFiles() throws InterruptedException
      Description copied from interface: ICodeBase
      Return whether or not this code base contains any source files.
      Specified by:
      containsSourceFiles in interface ICodeBase
      Returns:
      true if the code base contains source file(s), false if it does not contain source files
      Throws:
      InterruptedException
    • iterator

      public ICodeBaseIterator iterator() throws InterruptedException
      Description copied from interface: IScannableCodeBase
      Get an iterator over the resources in the this code base.
      Specified by:
      iterator in interface IScannableCodeBase
      Returns:
      ICodeBaseIterator over the resources in the code base
      Throws:
      InterruptedException
    • lookupResource

      public ICodeBaseEntry lookupResource(String resourceName)
      Description copied from interface: ICodeBase
      Look up a resource in this code base.
      Specified by:
      lookupResource in interface ICodeBase
      Parameters:
      resourceName - name of the resource to look up
      Returns:
      ICodeBaseEntry representing the resource or null if the resource cannot be found in this code base
    • setApplicationCodeBase

      public void setApplicationCodeBase(boolean isAppCodeBase)
      Description copied from interface: ICodeBase
      Designate this code base as an application codebase.
      Specified by:
      setApplicationCodeBase in interface ICodeBase
      Parameters:
      isAppCodeBase - true if this is an application codebase, false if not
    • isApplicationCodeBase

      public boolean isApplicationCodeBase()
      Description copied from interface: ICodeBase
      Return whether or not this codebase is an application codebase.
      Specified by:
      isApplicationCodeBase in interface ICodeBase
      Returns:
      true if this is an application codebase, false if not
    • setHowDiscovered

      public void setHowDiscovered(ICodeBase.Discovered howDiscovered)
      Description copied from interface: ICodeBase
      Set how this codebase was discovered.
      Specified by:
      setHowDiscovered in interface ICodeBase
      Parameters:
      howDiscovered - one of the constants SPECIFIED, NESTED, IN_JAR_MANIFEST, or IN_SYSTEM_CLASSPATH
    • getHowDiscovered

      public ICodeBase.Discovered getHowDiscovered()
      Description copied from interface: ICodeBase
      Return how this codebase was discovered.
      Specified by:
      getHowDiscovered in interface ICodeBase
      Returns:
      one of the constants SPECIFIED, NESTED, IN_JAR_MANIFEST, or IN_SYSTEM_CLASSPATH
    • setLastModifiedTime

      public void setLastModifiedTime(long lastModifiedTime)
      Description copied from interface: ICodeBase
      Set timestamp indicating the most recent time when any of the files in the codebase were modified.
      Specified by:
      setLastModifiedTime in interface ICodeBase
      Parameters:
      lastModifiedTime - timestamp when any codebase files were most-recently modified
    • getLastModifiedTime

      public long getLastModifiedTime()
      Description copied from interface: ICodeBase
      Get timestamp indicating the most recent time when any of the files in the codebase were modified. This information is only likely to be accurate if an ICodeBaseIterator has been used to scan the resources in the codebase (scannable codebases only, obviously).
      Specified by:
      getLastModifiedTime in interface ICodeBase
      Returns:
      timestamp when any codebase files were most-recently modified, -1 if unknown
    • getPathName

      public String getPathName()
      Description copied from interface: ICodeBase
      Get the filesystem pathname of this codebase.
      Specified by:
      getPathName in interface ICodeBase
      Returns:
      the filesystem pathname of this codebase, or null if this codebase is not accessible via the filesystem
    • close

      public void close()
      Description copied from interface: ICodeBase
      This method should be called when done using the code base.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface ICodeBase