Package com.norconex.commons.lang.jar
Class JarDuplicateFinder
java.lang.Object
com.norconex.commons.lang.jar.JarDuplicateFinder
Utility class for finding multiple instances of the same Jar that exists
either in different folder or the same, with the same name and version,
or same name but different versions. This class will consider Jar as
being duplicates based on their base name, not their content or any
other indicator.
- Since:
- 1.10.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<JarDuplicates> findJarDuplicates(@NonNull File... jarPaths) Finds all jar duplicates.static List<JarDuplicates> findJarDuplicates(@NonNull String... jarPaths) Finds all jar duplicates.static List<JarDuplicates> findJarDuplicates(@NonNull Collection<? extends File> jarPaths) Finds all jar duplicates.findJarDuplicatesOf(@NonNull File jarFile, @NonNull List<File> paths) Finds duplicates of a specific jar file, without returning that jar itself.static void
-
Method Details
-
findJarDuplicates
public static List<JarDuplicates> findJarDuplicates(@NonNull @NonNull Collection<? extends File> jarPaths) Finds all jar duplicates. Supplied paths can be any combination of jar files or directory of jar files. A jar file is any file with the ".jar" extension. Files with different extensions are ignored.- Parameters:
jarPaths- paths to either jar files or directories containing jars- Returns:
- list of jar duplicates, or an empty list when no duplicate Jars
are found, never
null. - Since:
- 3.0.0
-
findJarDuplicates
Finds all jar duplicates. Supplied paths can be any combination of jar files or directory of jar files. A jar file is any file with the ".jar" extension. Files with different extensions are ignored.- Parameters:
jarPaths- paths to either jar files or directories containing jars- Returns:
- list of jar duplicates, or an empty list when no duplicate Jars
are found, never
null.
-
findJarDuplicates
Finds all jar duplicates. Supplied paths can be any combination of jar files or directory of jar files. A jar file is any file with the ".jar" extension. Files with different extensions are ignored.- Parameters:
jarPaths- paths to either jar files or directories containing jars- Returns:
- list of jar duplicates, or an empty list when no duplicate Jars
are found, never
null.
-
findJarDuplicatesOf
public static List<JarFile> findJarDuplicatesOf(@NonNull @NonNull File jarFile, @NonNull @NonNull List<File> paths) Finds duplicates of a specific jar file, without returning that jar itself. Supplied target paths can be any combination of jar files or directory of jar files. A jar file is any file with the ".jar" extension. Files with different extensions are ignored.- Parameters:
jarFile- the Jar file being comparedpaths- paths to potential duplicate jar files or directories containing jar files- Returns:
- jar file duplicates, sorted from greatest to lowest, or an
empty list when no duplicate Jars are found, never
null - Since:
- 3.0.0
-
main
-