Interface ICodeBase

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
IScannableCodeBase
All Known Implementing Classes:
AbstractScannableCodeBase, DirectoryCodeBase, EmptyCodeBase, JrtfsCodeBase, NestedZipFileCodeBase, SingleFileCodeBase, ZipFileCodeBase, ZipInputStreamCodeBase

public interface ICodeBase extends AutoCloseable
Interface for a basic code base in which we can look up resources but not necessarily scan for the list of all resources.
Author:
David Hovemeyer
  • Method Details

    • getCodeBaseLocator

      ICodeBaseLocator getCodeBaseLocator()
      Get the codebase locator describing the location of this codebase.
      Returns:
      the ICodeBaseLocator
    • lookupResource

      ICodeBaseEntry lookupResource(String resourceName)
      Look up a resource in this code base.
      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

      void setApplicationCodeBase(boolean isAppCodeBase)
      Designate this code base as an application codebase.
      Parameters:
      isAppCodeBase - true if this is an application codebase, false if not
    • isApplicationCodeBase

      boolean isApplicationCodeBase()
      Return whether or not this codebase is an application codebase.
      Returns:
      true if this is an application codebase, false if not
    • setHowDiscovered

      void setHowDiscovered(ICodeBase.Discovered howDiscovered)
      Set how this codebase was discovered.
      Parameters:
      howDiscovered - one of the constants SPECIFIED, NESTED, IN_JAR_MANIFEST, or IN_SYSTEM_CLASSPATH
    • getHowDiscovered

      ICodeBase.Discovered getHowDiscovered()
      Return how this codebase was discovered.
      Returns:
      one of the constants SPECIFIED, NESTED, IN_JAR_MANIFEST, or IN_SYSTEM_CLASSPATH
    • containsSourceFiles

      boolean containsSourceFiles() throws InterruptedException
      Return whether or not this code base contains any source files.
      Returns:
      true if the code base contains source file(s), false if it does not contain source files
      Throws:
      InterruptedException
    • getPathName

      String getPathName()
      Get the filesystem pathname of this codebase.
      Returns:
      the filesystem pathname of this codebase, or null if this codebase is not accessible via the filesystem
    • setLastModifiedTime

      void setLastModifiedTime(long lastModifiedTime)
      Set timestamp indicating the most recent time when any of the files in the codebase were modified.
      Parameters:
      lastModifiedTime - timestamp when any codebase files were most-recently modified
    • getLastModifiedTime

      long getLastModifiedTime()
      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).
      Returns:
      timestamp when any codebase files were most-recently modified, -1 if unknown
    • close

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