public ResourceFinder(String path) { this(path, new ClassLoaderInterfaceDelegate(Thread.currentThread().getContextClassLoader()), null); }
public ResourceFinder(String path, URL... urls) { this(path, new ClassLoaderInterfaceDelegate(Thread.currentThread().getContextClassLoader()), urls); }
public ClassLoaderInterface getParent() { return classLoader.getParent() != null ? new ClassLoaderInterfaceDelegate(classLoader.getParent()) : null; } }
public ResourceFinder(URL... urls) { this(null, new ClassLoaderInterfaceDelegate(Thread.currentThread().getContextClassLoader()), urls); }
public ResourceFinder(String path, ClassLoaderInterface classLoaderInterface, URL... urls) { if (path == null){ path = ""; } else if (path.length() > 0 && !path.endsWith("/")) { path += "/"; } this.path = path; this.classLoaderInterface = classLoaderInterface == null ? new ClassLoaderInterfaceDelegate(Thread.currentThread().getContextClassLoader()) : classLoaderInterface ; for (int i = 0; urls != null && i < urls.length; i++) { URL url = urls[i]; if (url == null || isDirectory(url) || "jar".equals(url.getProtocol())) { continue; } try { urls[i] = new URL("jar", "", -1, url.toString() + "!/"); } catch (MalformedURLException e) { } } this.urls = (urls == null || urls.length == 0)? null : urls; }
protected ClassLoaderInterface getClassLoaderInterface() { /* if there is a ClassLoaderInterface in the context, use it, otherwise default to the default ClassLoaderInterface (a wrapper around the current thread classloader) using this, other plugins (like OSGi) can plugin their own classloader for a while and it will be used by Convention (it cannot be a bean, as Convention is likely to be called multiple times, and it need to use the default ClassLoaderInterface during normal startup) */ ClassLoaderInterface classLoaderInterface = null; ActionContext ctx = ActionContext.getContext(); if (ctx != null) classLoaderInterface = (ClassLoaderInterface) ctx.get(ClassLoaderInterface.CLASS_LOADER_INTERFACE); return ObjectUtils.defaultIfNull(classLoaderInterface, new ClassLoaderInterfaceDelegate(Thread.currentThread().getContextClassLoader())); }
protected ClassLoaderInterface getClassLoaderInterface() { if (isReloadEnabled()) { return new ClassLoaderInterfaceDelegate(this.reloadingClassLoader); } else { /* if there is a ClassLoaderInterface in the context, use it, otherwise default to the default ClassLoaderInterface (a wrapper around the current thread classloader) using this, other plugins (like OSGi) can plugin their own classloader for a while and it will be used by Convention (it cannot be a bean, as Convention is likely to be called multiple times, and it needs to use the default ClassLoaderInterface during normal startup) */ ClassLoaderInterface classLoaderInterface = null; ActionContext ctx = ActionContext.getContext(); if (ctx != null) { classLoaderInterface = (ClassLoaderInterface) ctx.get(ClassLoaderInterface.CLASS_LOADER_INTERFACE); } return ObjectUtils.defaultIfNull(classLoaderInterface, new ClassLoaderInterfaceDelegate(getClassLoader())); } }
protected ClassLoaderInterface getClassLoaderInterface() { if (isReloadEnabled()) return new ClassLoaderInterfaceDelegate(this.reloadingClassLoader); else { /* * if there is a ClassLoaderInterface in the context, use it, * otherwise default to the default ClassLoaderInterface (a wrapper * around the current thread classloader) using this, other plugins * (like OSGi) can plugin their own classloader for a while and it * will be used by Convention (it cannot be a bean, as Convention is * likely to be called multiple times, and it needs to use the * default ClassLoaderInterface during normal startup) */ ClassLoaderInterface classLoaderInterface = null; ActionContext ctx = ActionContext.getContext(); if (ctx != null) classLoaderInterface = (ClassLoaderInterface) ctx .get(ClassLoaderInterface.CLASS_LOADER_INTERFACE); return (ClassLoaderInterface) ObjectUtils.defaultIfNull( classLoaderInterface, new ClassLoaderInterfaceDelegate( getClassLoader())); } }
urlSet = urlSet.exclude(new ClassLoaderInterfaceDelegate(systemClassLoader.getParent()));
urlSet = urlSet.exclude(new ClassLoaderInterfaceDelegate(systemClassLoader.getParent()));