Package com.norconex.commons.lang.jar
Class JarDuplicates
- java.lang.Object
-
- com.norconex.commons.lang.jar.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 Summary
Constructors Constructor Description JarDuplicates(JarFile... jarFiles)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(File jarFile)Gets whether this duplicate batch contains the given jar file.JarFile[]getJarFiles()Gets the jar files being considered duplicates of each other.JarFilegetLatestVersion()Gets the jar file that is considered the most recent of the batch.booleanhasVersionConflict()Whether all jar files share the same version or if at least one of them have a different version.
-
-
-
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:
trueif 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:
trueif this instance contains the given jar file
-
-