Class ClassLoaderUtil

java.lang.Object
org.nuiton.util.ClassLoaderUtil

public class ClassLoaderUtil
extends java.lang.Object
A usefull class with method for ClassLoader
Author:
Tony Chemit - chemit@codelutin.com
  • Constructor Summary

    Constructors 
    Constructor Description
    ClassLoaderUtil()  
  • Method Summary

    Modifier and Type Method Description
    static java.net.URL[] getDeepURLs​(java.net.URLClassLoader loader)
    Returns the all urls to be used in a URLClassLoader.
    static java.net.URL[] getURLs​(java.net.URLClassLoader classLoader)
    Recupere la liste des urls d'un URLClassLoader.
    static void printLoader​(java.lang.ClassLoader loader)  

    Methods inherited from class java.lang.Object

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

  • Method Details

    • getDeepURLs

      public static java.net.URL[] getDeepURLs​(java.net.URLClassLoader loader)
      Returns the all urls to be used in a URLClassLoader. If classloader has only one url and the url is a jar, try to load in manifest class-path.
      Parameters:
      loader - the classloader (if null will use system one)
      Returns:
      all the url found in the classloader
    • getURLs

      public static java.net.URL[] getURLs​(java.net.URLClassLoader classLoader)
      Recupere la liste des urls d'un URLClassLoader. Note : Un cas particulier est positionné pour JBoss qui utilise la method getAllURLs.
      Parameters:
      classLoader - le class loader a scanner
      Returns:
      les urls du classloade.
    • printLoader

      public static void printLoader​(java.lang.ClassLoader loader)