public class

ClasspathJarSets

extends Object
implements DuplicateClassFinder
java.lang.Object
   ↳ com.atlassian.confluence.util.classpath.ClasspathJarSets

Class Overview

Contains a set of JAR files for each class on the classpath: the set of JARs that contain the class.

Ideally, a set of JARs for a given class should only include one JAR; if the set of JARs for a given class includes more than one JAR, the class is duplicated in several JARs in the classpath.

Summary

Public Constructors
ClasspathJarSets()
ClasspathJarSets(ClasspathClasses classpathClasses)
ClasspathJarSets(ClasspathClasses classpathClasses, Predicate classFileNamePredicate)
Public Methods
void addClass(String classFileName, JarSet jars)
SortedSet<String> getClassFileNames(JarSet jars)
Returns the class files in a given set of JARs, which may be one or more JARs.
SortedSet<String> getClassNames(JarSet jars)
Set<JarSet> getJarSetsWithCommonClasses()
SortedSet<String> getPackageNames(JarSet jars)
Returns the packages in a given set of JARs, which may be one or more JARs.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.util.classpath.DuplicateClassFinder

Public Constructors

public ClasspathJarSets ()

public ClasspathJarSets (ClasspathClasses classpathClasses)

public ClasspathJarSets (ClasspathClasses classpathClasses, Predicate classFileNamePredicate)

Public Methods

public void addClass (String classFileName, JarSet jars)

public SortedSet<String> getClassFileNames (JarSet jars)

Returns the class files in a given set of JARs, which may be one or more JARs.

The set is sorted by the natural order of the contents: the String class file names.
Parameters
jars a set of one or more JARs on the classpath
Returns
  • the class files in the JarSet. Each is a String in the form "java/lang/String.class". Returns an empty set if no classes are in that JarSet.

public SortedSet<String> getClassNames (JarSet jars)

public Set<JarSet> getJarSetsWithCommonClasses ()

Returns
  • the sets of JARs which have classes in common, i.e. any JarSet containing more than one JAR

public SortedSet<String> getPackageNames (JarSet jars)

Returns the packages in a given set of JARs, which may be one or more JARs. Each package is in the form "java/lang".

The set is sorted by the natural order of the contents: the String package names.
Parameters
jars a set of one or more JARs on the classpath
Returns
  • the packages found in the JarSet. Each is a String in the form "java/lang". Returns an empty set if no classes are in that JarSet.