/** * Loads resources from the module class loader */ @Override public Collection<URL> getResources(String name) { try { final HashSet<URL> resources = new HashSet<URL>(); Enumeration<URL> urls = module.getClassLoader().getResources(name); while (urls.hasMoreElements()) { resources.add(urls.nextElement()); } return resources; } catch (Exception e) { throw new ResourceLoadingException(e); } }
/** * If the class name is found in additionalClasses then return it. * * Otherwise the class will be loaded from the module ClassLoader */ @Override public Class<?> classForName(String name) { try { if (classes.containsKey(name)) { return classes.get(name); } final Class<?> clazz = module.getClassLoader().loadClass(name); classes.put(name, clazz); return clazz; } catch (ClassNotFoundException | LinkageError e) { throw new ResourceLoadingException(e); } }
/** * Loads a resource from the module class loader */ @Override public URL getResource(String name) { try { return module.getClassLoader().getResource(name); } catch (Exception e) { throw new ResourceLoadingException(e); } }
@Override public Class<?> classForName(String name) { try { return classLoader().loadClass(name); } catch (ClassNotFoundException e) { throw new ResourceLoadingException(ERROR_LOADING_CLASS + name, e); } catch (LinkageError e) { throw new ResourceLoadingException(ERROR_LOADING_CLASS + name, e); } catch (TypeNotPresentException e) { throw new ResourceLoadingException(ERROR_LOADING_CLASS + name, e); } }
@Override public Class<?> classForName(String name) { try { return classLoader().loadClass(name); } catch (ClassNotFoundException e) { throw new ResourceLoadingException(ERROR_LOADING_CLASS + name, e); } catch (LinkageError e) { throw new ResourceLoadingException(ERROR_LOADING_CLASS + name, e); } catch (TypeNotPresentException e) { throw new ResourceLoadingException(ERROR_LOADING_CLASS + name, e); } }
@Override public Class<?> classForName(String name) { try { return classLoader().loadClass(name); } catch (ClassNotFoundException e) { throw new ResourceLoadingException(ERROR_LOADING_CLASS + name, e); } catch (LinkageError e) { throw new ResourceLoadingException(ERROR_LOADING_CLASS + name, e); } catch (TypeNotPresentException e) { throw new ResourceLoadingException(ERROR_LOADING_CLASS + name, e); } }
@Override public Class<?> classForName(String name) { try { return classLoader().loadClass(name); } catch (ClassNotFoundException e) { throw new ResourceLoadingException(ERROR_LOADING_CLASS + name, e); } catch (LinkageError e) { throw new ResourceLoadingException(ERROR_LOADING_CLASS + name, e); } catch (TypeNotPresentException e) { throw new ResourceLoadingException(ERROR_LOADING_CLASS + name, e); } }
private Properties loadProperties(URL url) { Properties properties = new Properties(); try { properties.load(url.openStream()); } catch (IOException e) { throw new ResourceLoadingException(e); } return properties; }
public Class<?> classForName(String name) { try { return getClassLoader().loadClass(name); } catch (ClassNotFoundException e) { throw new ResourceLoadingException(e); } catch (LinkageError e) { throw new ResourceLoadingException(e); } }
private Properties loadProperties(URL url) { Properties properties = new Properties(); try { properties.load(url.openStream()); } catch (IOException e) { throw new ResourceLoadingException(e); } return properties; }
public Class<?> classForName(String name) { try { return getClassLoader().loadClass(name); } catch (ClassNotFoundException e) { throw new ResourceLoadingException(e); } catch (LinkageError e) { throw new ResourceLoadingException(e); } }
public Class<?> classForName(String name) { try { return getClassLoader().loadClass(name); } catch (ClassNotFoundException e) { throw new ResourceLoadingException(e); } catch (LinkageError e) { throw new ResourceLoadingException(e); } }
private Properties loadProperties(URL url) { Properties properties = new Properties(); try { properties.load(url.openStream()); } catch (IOException e) { throw new ResourceLoadingException(e); } return properties; }
private Properties loadProperties(URL url) { Properties properties = new Properties(); try { properties.load(url.openStream()); } catch (IOException e) { throw new ResourceLoadingException(e); } return properties; }
private static Properties loadProperties(URL url) { Properties properties = new Properties(); try { properties.load(url.openStream()); } catch (IOException e) { throw new ResourceLoadingException(e); } return properties; }
public Collection<URL> getResources(String name) { try { return new EnumerationList<URL>(Thread.currentThread().getContextClassLoader().getResources(name)); } catch (IOException e) { throw new ResourceLoadingException(e); } }
public Collection<URL> getResources(String name) { try { final ClassLoader tccl = Thread.currentThread().getContextClassLoader(); if (tccl != null) { return Collections.asList(tccl.getResources(name)); } else { return Collections.asList(getClass().getClassLoader().getResources(name)); } } catch (IOException e) { throw new ResourceLoadingException(e); } }
public Collection<URL> getResources(String name) { try { final ClassLoader tccl = Thread.currentThread().getContextClassLoader(); if (tccl != null) { return Collections.asList(tccl.getResources(name)); } else { return Collections.asList(getClass().getClassLoader().getResources(name)); } } catch (IOException e) { throw new ResourceLoadingException(e); } }
public Collection<URL> getResources(String name) { try { final ClassLoader tccl = Thread.currentThread().getContextClassLoader(); if (tccl != null) { return Collections.asList(tccl.getResources(name)); } else { return Collections.asList(getClass().getClassLoader().getResources(name)); } } catch (IOException e) { throw new ResourceLoadingException(e); } }
@Override public Collection<URL> getResources(String name) { try { return new EnumerationList<>(classLoader().getResources(name)); } catch (IOException e) { throw new ResourceLoadingException("Error loading resource " + name, e); } }