@Override protected Enumeration<URL> findResources(String resource) throws IOException { List<URL> result = new ArrayList<URL>(Collections.list(super.findResources(resource))); findResourcesInJarFiles(result, resource); findResourcesInJavaFileObjectRegistry(result, resource); return Collections.enumeration(result); }
/** * Returns an enumeration of URLs for the resource with the specified name. * This implementation first uses this class loader's parent to find the * resource, then it calls {@link #findResources(String)} to get additional * URLs. The returned enumeration contains the {@code URL} objects of both * find operations. * * @return an enumeration of {@code URL} objects for the requested resource. * @param resName * the name of the resource to find. * @throws IOException * if an I/O error occurs. */ @SuppressWarnings("unchecked") public Enumeration<URL> getResources(String resName) throws IOException { Enumeration first = parent.getResources(resName); Enumeration second = findResources(resName); return new TwoEnumerationsInOne(first, second); }
@Override protected Enumeration<URL> findResources(String name) throws IOException { if ("META-INF/MANIFEST.MF".equals(name)) { URL u1 = new URL("jar:" + war.toURI().toURL() + "!/META-INF/MANIFEST.MF"); URL u2 = new URL("jar:" + ("jar:" + war.toURI().toURL() + "!/WEB-INF/lib/my.jar") + "!/META-INF/MANIFEST.MF"); return Collections.enumeration(Arrays.asList(u1, u2)); } else if ("java/util".equals(name)) { String u = "jar:" + ("jar:" + war.toURI().toURL() + "!/WEB-INF/lib/my.jar") + "!/java/util/"; return Collections.enumeration(Collections.singleton(new URL(u))); } else { return super.findResources(name); } } };
protected Enumeration<URL> findResources(String name) throws IOException { if (maskResources) { return EMPTY; } return super.findResources(name); }
@Override protected Enumeration<URL> findResources(String name) throws IOException { return super.findResources(name); }
@Override public Enumeration<URL> findResources(String name) throws IOException { return super.findResources(name); }
ClassLoader cl = Thread.currentThread().getContextClassLoader(); Enumeration<URL> enm = cl.findResources("META-INF/device-classes.txt"); while (enm.hasMoreElements()) { runAllClassesIn(enm.nextElement()); }
@Override public Enumeration<URL> getResources(String name) throws IOException { if (isLocalResource(name)) { return super.findResources(name); } else { return super.getResources(name); } }
@Override public Enumeration<URL> getResources(String name) throws IOException { if (isLocalResource(name)) { return super.findResources(name); } else { return super.getResources(name); } }
@Override public Enumeration<URL> findResources(String name) throws IOException { if (isUnit(name)) { return junit.getResources(name); } if (name.equals("META-INF/services/java.util.logging.Handler")) { // NOI18N return junit.getResources("org/netbeans/junit/internal/FakeMetaInf.txt"); // NOI18N } return super.findResources(name); }
protected Enumeration<URL> findResources(String name) throws IOException { Vector<URL> vector = new Vector<URL>(); for (ClassLoader classLoader : classLoaders) { Enumeration<URL> enumeration = classLoader.getResources(name); while (enumeration.hasMoreElements()) { vector.add(enumeration.nextElement()); } } Enumeration<URL> enumeration = super.findResources(name); while (enumeration.hasMoreElements()) { vector.add(enumeration.nextElement()); } return vector.elements(); }
protected Enumeration<URL> findResources(String name) throws IOException { Vector<URL> vector = new Vector<URL>(); for (ClassLoader classLoader : classLoaders) { Enumeration<URL> enumeration = classLoader.getResources(name); while (enumeration.hasMoreElements()) { vector.add(enumeration.nextElement()); } } Enumeration<URL> enumeration = super.findResources(name); while (enumeration.hasMoreElements()) { vector.add(enumeration.nextElement()); } return vector.elements(); }
@Implementation @Override protected Enumeration<URL> findResources(String name) throws IOException { return super.findResources(name); }
@Override protected Enumeration<URL> findResources(String name) throws IOException { return super.findResources(name); } }
@Override protected Enumeration<URL> findResources(String name) throws IOException { // Don't try to load resources from the bundle when it is not active if (bundle.getState() == Bundle.ACTIVE) { Enumeration<URL> urls = bundle.getResources(name); if (urls != null) { return urls; } } return super.findResources(name); } });
@Override protected Enumeration<URL> findResources(String resource) throws IOException { List<URL> result = new ArrayList<URL>(Collections.list(super.findResources(resource))); findResourcesInJarFiles(result, resource); findResourcesInJavaFileObjectRegistry(result, resource); return Collections.enumeration(result); }
@Override protected Enumeration<URL> findResources(String resource) throws IOException { List<URL> result = new ArrayList<URL>(Collections.list(super.findResources(resource))); findResourcesInJarFiles(result, resource); findResourcesInJavaFileObjectRegistry(result, resource); return Collections.enumeration(result); }
@Override public Enumeration<URL> findResources(String name) throws IOException { if (isValidResource(name)) { return super.findResources(name); } return new CompoundEnumeration<URL>(new Enumeration[0]); }
@Override protected Enumeration<URL> findResources(final String name) throws IOException { final List<Archive<?>> node = findNodes(name); if (!node.isEmpty()) { final List<URL> urls = new ArrayList<>(); for (final Archive<?> i : node) { urls.add(new URL(null, "archive:" + i.getName() + (!name.startsWith("/") ? "/" : "") + name, new ArchiveStreamHandler())); } return enumerator(urls); } return super.findResources(name); }
@Override protected Enumeration<URL> findResources(final String name) throws IOException { ArchivePath path = ArchivePaths.create(prefix + name); Node node = archive.get(path); if (node == null) { path = ArchivePaths.create(name); node = archive.get(path); } if (node != null) { return enumerator(new URL(null, "archive:" + archive.getName() + "/" + name, new ArchiveStreamHandler())); } return super.findResources(name); }