Class JarFilePath

java.lang.Object
com.iizix.util.JarFilePath

public final class JarFilePath extends Object
Class holding an IJarFile and a path inside the Jar file for the JarClassLoader.
Author:
Christopher Mindus
  • Constructor Summary

    Constructors
    Constructor
    Description
    JarFilePath(IJarFile jarFile, String subDirectory)
    Constructor for a JarFile with a subdirectory path.
    JarFilePath(File directory)
    Constructor for a directory on the file system.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if two objects are equal: two class path entries are equal when they name the same directory on the file system, or the same Jar file and the same subdirectory inside it (the root, however spelled, is one subdirectory: normalized at construction).
    int
    Gets the hash code.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JarFilePath

      public JarFilePath(IJarFile jarFile, String subDirectory)
      Constructor for a JarFile with a subdirectory path.
      Parameters:
      jarFile - The Jar file.
      subDirectory - The subdirectory or null for Jar file root.
      Throws:
      IllegalArgumentException - If the subDirectory is not found in the Jar file.
    • JarFilePath

      public JarFilePath(File directory) throws IOException
      Constructor for a directory on the file system.
      Parameters:
      directory - The instance must be an existing directory.
      Throws:
      IOException - If the instance does not exist or is not a directory.
  • Method Details

    • equals

      public boolean equals(Object o)
      Checks if two objects are equal: two class path entries are equal when they name the same directory on the file system, or the same Jar file and the same subdirectory inside it (the root, however spelled, is one subdirectory: normalized at construction). Before CC-FIX-JARFILEPATH-EQUALS, any two directory entries and any two entries on one Jar file compared equal whatever their directories, while the hash code told them apart.
      Overrides:
      equals in class Object
      Returns:
      true if equal, false otherwise.
    • hashCode

      public int hashCode()
      Gets the hash code.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code.