@Override public Enumeration<URL> findResources(String name) throws IOException { // System.out.println(this+" being asked to find resources "+name); return super.findResources(name); }
if (this.oneNestedJarUrlBase == null || this.embeddedJarPathsInNestedJar.isEmpty()) { return super.findResources(resourceName); } else { for (final Enumeration<URL> rootUrls = super.findResources(resourceName); rootUrls.hasMoreElements(); ) { urls.add(rootUrls.nextElement());
@Override public Enumeration<URL> findResources(String name) throws IOException { if (name.equals("META-INF/services/io.vertx.core.spi.VertxMetricsFactory")) { File f = File.createTempFile("vertx", ".txt"); f.deleteOnExit(); Files.write(f.toPath(), factoryFqn.getBytes()); return Collections.enumeration(Collections.singleton(f.toURI().toURL())); } return super.findResources(name); } };
moduleInfosInClassPath = urlClassLoader.findResources(TerasologyConstants.MODULE_INFO_FILENAME.toString()); } catch (IOException e) { logger.warn("Failed to search for classpath modules: {}", e);
/** * Returns an Enumeration of URLs representing all of the resources on the URL search path having the specified name. * * @param name the resource name. * @return an {@code Enumeration} of {@code URL}s. * @throws IOException if an I/O exception occurs. */ @Override public Enumeration<URL> findResources(String name) throws IOException { if (excludeClassNames.contains(resNameToClassName(name))) { return new Enumeration<URL>() { @Override public boolean hasMoreElements() { return false; } @Override public URL nextElement() { throw new UnsupportedOperationException(); } }; } return super.findResources(name); } }
@Override protected Enumeration<URL> findResources(String name) throws IOException { return urlClassLoader.findResources(name); }
@Nonnull @Override public Enumeration<URL> getResources(@Nonnull final String name) throws IOException { if (name.startsWith(SERVICES_PREFIX)) { return delegate.findResources(name); } else { return super.getResources(name); } } }
for (Enumeration<URL> en = super.findResources(name); en.hasMoreElements();) { URL url = en.nextElement(); try {
@Override public Enumeration<URL> findResources(String name) throws IOException { if (name.equals("META-INF/services/io.vertx.core.spi.VertxMetricsFactory")) { File f = File.createTempFile("vertx", ".txt"); f.deleteOnExit(); Files.write(f.toPath(), factoryFqn.getBytes()); return Collections.enumeration(Collections.singleton(f.toURI().toURL())); } return super.findResources(name); } };
systemUrls = system.getResources(name); Enumeration<URL> localUrls = findResources(name); Enumeration<URL> parentUrls = null; if (getParent() != null) {
return; for (Enumeration<URL> enm = super.findResources(name); enm.hasMoreElements();) { URL url = enm.nextElement(); if (isResourceVisible(name, url, requestor)) {
public Enumeration<URL> findResources( String name ) throws IOException { return super.findResources( name ); }
public Enumeration<URL> loadResourcesFromSelf( String name ) { try { return super.findResources( name ); } catch ( IOException e ) { return null; } }
/** * Find the resource. * @param name The name. * @return The url. */ protected Enumeration<URL> findDirectResources(String name) throws IOException { return super.findResources(name); }
public Enumeration findRealmResources( String name ) throws IOException { return super.findResources( name ); }
/** Find resources from this ClassLoader, and don't search the realm. * Otherwise we'd recurse indefinitely. * * @return The resource. */ public Enumeration findResourcesDirect(String name) throws IOException { return super.findResources( name ); } }
/** * Find the resource. * @param name The name. * @return The url. */ protected Enumeration<URL> findDirectResources(String name) throws IOException { return super.findResources(name); }
public List<URL> filterUrls(String resource) throws Exception { List<URL> urlList = new ArrayList<>(); Enumeration<URL> enumeration = urlClassLoader.findResources(resource); while (enumeration.hasMoreElements()) { URL resourceUrl = enumeration.nextElement(); String resourceFile = resourceUrl.getFile(); String jarFile = resourceFile.substring(0, resourceFile.length() - resource.length() - FILE_IN_JAR.length()); urlList.add(new URL(jarFile)); } return urlList; }
public List<URL> filterUrls(String resource) throws Exception { List<URL> urlList = new ArrayList<>(); Enumeration<URL> enumeration = urlClassLoader.findResources(resource); while (enumeration.hasMoreElements()) { URL resourceUrl = enumeration.nextElement(); String resourceFile = resourceUrl.getFile(); String jarFile = resourceFile.substring(0, resourceFile.length() - resource.length() - FILE_IN_JAR.length()); urlList.add(new URL(jarFile)); } return urlList; }
private static void scanEpisodeFile(File jar, SchemaCompiler sc) throws BadCommandLineException, IOException { URLClassLoader ucl = new URLClassLoader(new URL[]{jar.toURI().toURL()}); Enumeration<URL> resources = ucl.findResources("META-INF/sun-jaxb.episode"); while (resources.hasMoreElements()) { URL url = resources.nextElement(); sc.getOptions().addBindFile(new InputSource(url.toExternalForm())); } }