Class ClassPathUtil


  • public class ClassPathUtil
    extends java.lang.Object
    Some utility methods for working with the Java class path.
    Author:
    David Hovemeyer
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassPathUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String findCodeBaseInClassPath​(java.lang.String codeBaseName, java.lang.String classPath)
      Try to find a codebase with the given name in the given class path string.
      static java.lang.String findCodeBaseInClassPath​(java.util.regex.Pattern codeBaseNamePattern, java.lang.String classPath)
      Try to find a codebase matching the given pattern in the given class path string.
      static java.lang.String[] getJavaClassPath()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassPathUtil

        public ClassPathUtil()
    • Method Detail

      • findCodeBaseInClassPath

        public static java.lang.String findCodeBaseInClassPath​(@Nonnull
                                                               java.lang.String codeBaseName,
                                                               java.lang.String classPath)
        Try to find a codebase with the given name in the given class path string.
        Parameters:
        codeBaseName - name of a codebase (e.g., "findbugs.jar")
        classPath - a classpath
        Returns:
        full path of named codebase, or null if the codebase couldn't be found
      • findCodeBaseInClassPath

        public static java.lang.String findCodeBaseInClassPath​(java.util.regex.Pattern codeBaseNamePattern,
                                                               java.lang.String classPath)
        Try to find a codebase matching the given pattern in the given class path string.
        Parameters:
        codeBaseNamePattern - pattern describing a codebase (e.g., compiled from the regex "findbugs\\.jar$")
        classPath - a classpath
        Returns:
        full path of named codebase, or null if the codebase couldn't be found
      • getJavaClassPath

        public static java.lang.String[] getJavaClassPath()