Class ClassPathUtil

java.lang.Object
com.github.toolarium.common.util.ClassPathUtil

public final class ClassPathUtil extends Object
Class path util
  • Method Details

    • getInstance

      public static ClassPathUtil getInstance()
      Get the instance
      Returns:
      the instance
    • searchArchiveByName

      public String searchArchiveByName(String archiveName)
      Search an archive
      Parameters:
      archiveName - the archive to search
      Returns:
      the full archive path ot null if it does not exist
    • searchArchiveByRegExp

      public List<String> searchArchiveByRegExp(String regExp)
      Search archive by regular expression
      Parameters:
      regExp - the search regular expression
      Returns:
      a list with full qualified class names or null if it does not exist
    • searchClassByName

      public List<String> searchClassByName(String className)
      Search a specific class
      Parameters:
      className - the name of the class with or without package name
      Returns:
      a list with full qualified class names or null if it does not exist
    • searchClassByRegExp

      public List<String> searchClassByRegExp(String regExp)
      Search class by regular expression
      Parameters:
      regExp - the search regular expression
      Returns:
      a list with full qualified class names or null if it does not exist
    • searchClassByPackageName

      public List<String> searchClassByPackageName(String packageName)
      Search classes from a specific package
      Parameters:
      packageName - the name of the package
      Returns:
      a list with full qualified class names or null if it does not exist
    • checkClassByName

      public boolean checkClassByName(String className)
      Check if a given class is in the class path
      Parameters:
      className - the name of the class with or without package name
      Returns:
      true if the class exists; otherwise false
    • searchFileByRegExp

      public List<String> searchFileByRegExp(String regExp)
      Search file by regular expression
      Parameters:
      regExp - the search regular expression
      Returns:
      a list with full qualified class names or null if it does not exist
    • searchFileByRegExpAsURLList

      public List<URL> searchFileByRegExpAsURLList(String regExp)
      Search file by regular expression
      Parameters:
      regExp - the search regular expression
      Returns:
      a list with full qualified class names or null if it does not exist
    • getClassPaths

      public Set<String> getClassPaths()
      Returns a list of all the class paths in the current VM.
      Returns:
      the class paths in current vm