/** * 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); } }
private boolean isJSF12(ModuleDependency moduleDependency, String identifier) throws ModuleLoadException { // The class javax.faces.event.NamedEvent was introduced in JSF 2.0 return (moduleDependency.getModuleLoader().loadModule(identifier) .getClassLoader().getResource("/javax/faces/event/NamedEvent.class") == null); }
public URL loadResourceAsURL(String uri) { IllegalArgumentAssertion.assertNotNull(uri, "uri"); String resolvedName = FileUtil.compactPath(uri, '/'); return classLoader.getResource(resolvedName); }
/** * 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); } }
private static URL resolveResource(String path) { Path candidate = Paths.get(path); if (Files.exists(candidate)) { try { return candidate.toUri().toURL(); } catch (MalformedURLException e) { // ignore } } URL yml = null; try { Module appModule = Module.getBootModuleLoader().loadModule("thorntail.application"); yml = appModule.getClassLoader().getResource(path); if (yml != null) { return yml; } } catch (ModuleLoadException e) { // ignore; } yml = ClassLoader.getSystemClassLoader().getResource(path); return yml; }
public URL loadResourceAsURL(String uri) { IllegalArgumentAssertion.assertNotNull(uri, "uri"); String resolvedName = FileUtil.compactPath(uri, '/'); return classLoader.getResource(resolvedName); }
private static URL resolveResource(String path) { Path candidate = Paths.get(path); if (Files.exists(candidate)) { try { return candidate.toUri().toURL(); } catch (MalformedURLException e) { // ignore } } URL yml = null; try { Module appModule = Module.getBootModuleLoader().loadModule("thorntail.application"); yml = appModule.getClassLoader().getResource(path); if (yml != null) { return yml; } } catch (ModuleLoadException e) { // ignore; } yml = ClassLoader.getSystemClassLoader().getResource(path); return yml; }
private static URL resolveResource(String path) { Path candidate = Paths.get(path); if (Files.exists(candidate)) { try { return candidate.toUri().toURL(); } catch (MalformedURLException e) { // ignore } } URL yml = null; try { Module appModule = Module.getBootModuleLoader().loadModule("swarm.application"); yml = appModule.getClassLoader().getResource(path); if (yml != null) { return yml; } } catch (ModuleLoadException e) { // ignore; } yml = ClassLoader.getSystemClassLoader().getResource(path); return yml; }
URL res = classLoader.getResource(baseName + ".class"); if (res != null) { URLConnection con = res.openConnection();
URL fileUrl = module.getClassLoader().getResource(JAR_LOCATION);
if (jks == null) { Module appModule = Module.getCallerModuleLoader().loadModule("thorntail.application"); jks = appModule.getClassLoader().getResource(keystorePath);
URL fileUrl = module.getClassLoader().getResource(JAR_LOCATION);
for (String s : Module.systemPaths) { if (canonPath.startsWith(s)) { return moduleClassLoader.getResource(canonPath);
for (String s : Module.systemPaths) { if (canonPath.startsWith(s)) { return moduleClassLoader.getResource(canonPath);