brooklyn.util.javalang.UrlClassLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of brooklyn-core Show documentation
Show all versions of brooklyn-core Show documentation
Entity implementation classes, events, and other core elements
package brooklyn.util.javalang;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Arrays;
import brooklyn.util.ResourceUtils;
import brooklyn.util.exceptions.Exceptions;
/** like URLClassLoader (and delegates to it) but:
* * has a nice toString
* * supports var args constructor
* * supports file://~/xxx semantics (remaps it to user.home);
* ideally we'd also support mvn, classpath, osgi, etc
*/
public class UrlClassLoader extends URLClassLoader {
private URL[] urls;
public UrlClassLoader(URL ...urls) {
super(tidy(urls));
this.urls = urls;
}
public UrlClassLoader(String ...urls) {
this(asUrls(urls));
}
private static URL[] asUrls(String[] urls) {
URL[] urlo = new URL[urls.length];
try {
for (int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy