Class JarDuplicates


  • public class JarDuplicates
    extends Object
    Holds jar files that are considered duplicates (same name and same or different versions).
    Since:
    1.10.0
    Author:
    Pascal Essiembre
    • Constructor Detail

      • JarDuplicates

        public JarDuplicates​(JarFile... jarFiles)
    • Method Detail

      • getJarFiles

        public JarFile[] getJarFiles()
        Gets the jar files being considered duplicates of each other.
        Returns:
        jar files
      • getLatestVersion

        public JarFile getLatestVersion()
        Gets the jar file that is considered the most recent of the batch. If two ore more jars share the same latest version, there is no guarantee which one will be returned. The best attempt is made to detect more recent version based on version provided. Given version patterns may vary, there is no guarantee of 100% accuracy, so use with caution.
        Returns:
        latest jar file
      • hasVersionConflict

        public boolean hasVersionConflict()
        Whether all jar files share the same version or if at least one of them have a different version.
        Returns:
        true if at least one jar file has a different version
      • contains

        public boolean contains​(File jarFile)
        Gets whether this duplicate batch contains the given jar file.
        Parameters:
        jarFile - jar file
        Returns:
        true if this instance contains the given jar file