List of utility methods to do Class Loader
InputStream | getStreamForPath(ClassLoader loader, String path) get Stream For Path URL url = loader.getResource(path); if (url == null) { return null; if (url.getProtocol().equals("file")) { try { return new FileInputStream(new File(url.toURI())); } catch (URISyntaxException e) { ... |
ClassLoader | getToolsClassLoader() get Tools Class Loader ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader(); return new URLClassLoader(new URL[] { getToolsJarUrl() }, systemClassLoader); |
boolean | isBizServicesLocatorXmlLoaded(File f, ClassLoader classLoader) is Biz Services Locator Xml Loaded if ((f == null) || (!f.exists())) { return false; File biz = new File(f.getAbsolutePath() + "/biz"); if (!biz.exists()) { System.err.println("Path not exists:" + biz); final List<String> filenames = new ArrayList<String>(); ... |
Set | load(Class load String serviceFile = SERVICES + "/" + serviceClass.getName(); LinkedHashSet<Class<? extends T>> providers = new LinkedHashSet<Class<? extends T>>(); LinkedHashSet<Class<? extends T>> vetoedProviders = new LinkedHashSet<Class<? extends T>>(); try { Enumeration<URL> enumeration = loader.getResources(serviceFile); while (enumeration.hasMoreElements()) { final URL url = enumeration.nextElement(); final InputStream is = url.openStream(); ... |
Class> | load(String className) load return Class.forName(className);
|
Class> | load(String path, String className) load Class<?> clazz = classMap.get(className); if (clazz == null) { clazz = doLoad(path, className); if (clazz != null) { classMap.put(className, clazz); return clazz; ... |
List | loadAllAutoConfigFiles(ClassLoader classloader) load All Auto Config Files List<URL> urlList = new ArrayList<URL>(); urlList.addAll(loadAutoConfigFiles(classloader, "META-INF/autoconf/auto-config.xml")); urlList.addAll(loadAutoConfigFiles(classloader, "META-INF/auto-config.xml")); return urlList; |
Class> | loadArrayClass(ClassLoader cl, String aName) load Array Class Class<?> componentType = null; int[] dimensions = null; int dot = 0; while (componentType == null) { char dotChar = aName.charAt(dot); if (dotChar == '[') { dot++; continue; ... |
Class> | loadClass(ClassLoader cl, String cName) Loads the class from the given classloader or returns null (does not throw). if (cName.startsWith("[")) { return loadArrayClass(cl, cName); try { return cl.loadClass(cName); } catch (Throwable th) { return null; |
Class> | loadClass(final File baseFolder, final String qualifiedType) load Class try { return getClassLoaderForDirectory(baseFolder).loadClass(qualifiedType); } catch (ClassNotFoundException | MalformedURLException e) { throw new IllegalStateException(e); |