Class ClassloaderUtils


  • public class ClassloaderUtils
    extends Object
    Provides a class loader utility.
    • Constructor Detail

      • ClassloaderUtils

        public ClassloaderUtils()
    • Method Detail

      • findResourcePaths

        public static void findResourcePaths​(String resourcePath)
        Provides debugging information about the classloader for the resources.
        Parameters:
        resourcePath - the resource which shall be located
      • findResourcePaths

        public static void findResourcePaths​(String resourcePath,
                                             Class localClass)
        For debugging purposes. This attempts to load the specified resource (e.g. "javax/jws/WebService.class") using the thread local, system and class-specific class loader and writes the findings to System.out This can be used to investigate whether multiple versions of a resource are visible to the classloader
        Parameters:
        resourcePath - the resource which shall be located
        localClass - the class to get the class-specific classloader for
      • getClasspathResource

        public static String getClasspathResource​(String resourcePath,
                                                  Class localClass)
        Return the text content for the given class path resource and class.
        Parameters:
        resourcePath - the class path resource (required)
        localClass - the local class (optional)
        Returns:
        the text content for the given class path resource and class
        Since:
        4.3.2