Returns an Enumeration of URLs representing all of the resources
on the URL search path having the specified name.

@param name the resource name
@exception IOException if an I/O exception occurs
@return an <code>Enumeration</code> of <code>URL</code>s
500352
@Override
	@Pure
	public Enumeration<URL> findResources(final String name) throws IOException {
		final Enumeration<?> e = this.ucp.findResources(name, true);

		return new Enumeration<URL>() {
			private URL url;

			private boolean next() {
				if (this.url != null) {
					return true;
				}
				do {
					final URL u = AccessController.doPrivileged(new PrivilegedAction<URL>() {
						@Override
						public URL run() {
							if (!e.hasMoreElements()) {
								return null;
							}
							return (URL) e.nextElement();
						}
					}, DynamicURLClassLoader.this.acc);
					if (u == null) {
						break;
					}
					this.url = DynamicURLClassLoader.this.ucp.checkURL(u);
				}
				while (this.url == null);

				return this.url != null;
			}

			@Override
			public URL nextElement() {
				if (!next()) {
					throw new NoSuchElementException();
				}
				final URL u = this.url;
				this.url = null;
				return u;
			}

			@Override
			public boolean hasMoreElements() {
				return next();
			}
		};
	}
1143694
private Set<String> getResourceNamesFromJar(String path, URL resourceURL) {

		URLConnection con = null;

		try {
			if (resourceURL.toString().startsWith(JawrConstant.JAR_URL_PREFIX)) {
				con = resourceURL.openConnection();
			}
		} catch (IOException e) {

			if (LOGGER.isDebugEnabled()) {
				LOGGER.debug("Unable to find resources name for path '" + path + "'", e);
			}
			return Collections.emptySet();
		}

		JarFile jarFile;
		String jarFileUrl;
		String rootEntryPath;
		boolean newJarFile = false;

		try {
			if (con instanceof JarURLConnection) {
				// Should usually be the case for traditional JAR files.
				JarURLConnection jarCon = (JarURLConnection) con;
				jarCon.setUseCaches(true);
				jarFile = jarCon.getJarFile();
				JarEntry jarEntry = jarCon.getJarEntry();
				rootEntryPath = (jarEntry != null ? jarEntry.getName() : "");
			} else {
				// No JarURLConnection -> need to resort to URL file parsing.
				// We'll assume URLs of the format "jar:path!/entry", with the
				// protocol
				// being arbitrary as long as following the entry format.
				// We'll also handle paths with and without leading "file:"
				// prefix.
				String urlFile = resourceURL.getFile();
				int separatorIndex = urlFile.indexOf(JAR_URL_SEPARATOR);
				if (separatorIndex != -1) {
					jarFileUrl = urlFile.substring(0, separatorIndex);
					rootEntryPath = urlFile.substring(separatorIndex + JAR_URL_SEPARATOR.length());
					jarFile = getJarFile(jarFileUrl);
				} else {
					jarFile = new JarFile(urlFile);
					rootEntryPath = "";
				}
				newJarFile = true;
			}
		} catch (IOException e) {
			if (LOGGER.isDebugEnabled()) {
				LOGGER.debug("Unable to find resources name for path '" + path + "'", e);
			}
			return Collections.emptySet();
		}
		try {
			if (!"".equals(rootEntryPath) && !rootEntryPath.endsWith("/")) {
				// Root entry path must end with slash to allow for proper
				// matching.
				// The Sun JRE does not return a slash here, but BEA JRockit
				// does.
				rootEntryPath = rootEntryPath + "/";
			}
			Set<String> result = new LinkedHashSet<>(8);
			for (Enumeration<JarEntry> entries = jarFile.entries(); entries.hasMoreElements();) {
				JarEntry entry = entries.nextElement();
				String entryPath = entry.getName();
				if (isDirectChildPath(rootEntryPath, entryPath)) {
					String relativePath = entryPath.substring(rootEntryPath.length());
					result.add(relativePath);
				}
			}
			return result;
		} finally {
			// Close jar file, but only if freshly obtained -
			// not from JarURLConnection, which might cache the file reference.
			if (newJarFile) {
				try {
					jarFile.close();
				} catch (IOException e) {
					// Nothing to do
				}
			}
		}
	}
981652
@Override
    @SuppressWarnings("unchecked")
    protected Enumeration<URL> findResources( final String name )
        throws IOException
    {
        Enumeration<URL> resources = m_bundle.getResources( name );
        // Bundle.getResources may return null, in such case return empty enumeration
        if( resources == null )
        {
            return EMPTY_URL_ENUMERATION;
        }
        else
        {
            return resources;
        }
    }
657758
@Override
  public PathImpl getPath(String name)
  {
    if (name.startsWith("/"))
      return _path.lookup("." + name);
    else
      return _path.lookup(name);
  }
659186
public static URL getResource(String name) {
        URL resource = null;
        try {
            if (Thread.currentThread().getContextClassLoader() != null) {
                resource = Thread.currentThread().getContextClassLoader().getResource(name);
            }
        } catch (SecurityException e) {
            LOG.info("Unable to access context classloader, using default. " + e.getMessage());
        }
        if (resource == null) {
            resource = ResourceLoader.class.getResource("/" + name);
        }
        return resource;
    }
400105
public static URL getResourceURL(String resource) throws IOException {
    URL url = null;
    ClassLoader loader = ResourcesUtils.class.getClassLoader();
    if (loader != null) {
      url = loader.getResource(resource);
    }
    if (url == null) {
      url = ClassLoader.getSystemResource(resource);
    }
    if (url == null) {
      throw new IOException("Could not find resource " + resource);
    }
    return url;
  }
472331
public InputStream getResourceAsStream(final String name) {
        for ( final ClassLoader classLoader : this.classLoaders ) {
            InputStream stream = classLoader.getResourceAsStream( name );
            if ( stream != null ) {
                return stream;
            }
        }

        return null;
    }
969821
@Override
   @SuppressWarnings("unchecked")
   protected Enumeration<URL> findResources(String name) {
      final List<Enumeration<URL>> enumerations = new ArrayList<>();

      for (WeakReference<Bundle> ref : bundles) {
         final Bundle bundle = ref.get();
         if (bundle != null && bundle.getState() == Bundle.ACTIVE) {
            try {
               final Enumeration<URL> resources = bundle.getResources(name);
               if (resources != null) {
                  enumerations.add(resources);
               }
            } catch (Exception ignore) {
            }
         }
      }

      return new Enumeration<URL>() {

         @Override
         public boolean hasMoreElements() {
            for (Enumeration<URL> enumeration : enumerations) {
               if (enumeration != null && enumeration.hasMoreElements()) {
                  return true;
               }
            }
            return false;
         }

         @Override
         public URL nextElement() {
            for (Enumeration<URL> enumeration : enumerations) {
               if (enumeration != null && enumeration.hasMoreElements()) {
                  return enumeration.nextElement();
               }
            }
            throw new NoSuchElementException();
         }
      };
   }
640889
public List<String> params(String name) {
		List<String> values = queryParams.get(name);
		String value = pathParams.get(name);

		if (values == null) {
			return (value == null) ? Collections.<String>emptyList() : Collections.singletonList(value);
		}

		if (value == null) {
			return Collections.unmodifiableList(values);
		} else {
			List<String> aggregated = new ArrayList<String>(values.size() + 1);
			aggregated.addAll(values);
			aggregated.add(value);
			return Collections.unmodifiableList(aggregated);
		}
	}
831298
public Resource getResource(String name, Locale locale, String encoding) throws IOException {
        name = UrlUtils.cleanName(name);
        locale = cleanLocale(locale);
        return loadResource(name, locale, encoding);
    }
1279826
public final Enumeration findResources(final String name)
			throws IOException {
		final CClassLoader loader = CClassLoader.getRootLoader();
		final List URLList = new ArrayList();

		try {
			CClassLoader.loadResources(loader, URLList, name);
		} finally {
			try {

			} catch (final Exception ignore) {
			}
		}

		try {
			final Enumeration eu = CClassLoader.getRootLoader().getParent()
					.getResources(name);
			while (eu.hasMoreElements()) {
				URLList.add(eu.nextElement());
			}
		} catch (final Throwable ignore) {
		}

		final Iterator it = URLList.iterator();

		return new Enumeration() {
			Iterator internalIt = it;

			public boolean hasMoreElements() {
				return this.internalIt.hasNext();
			} // end hasMoreElements()

			public Object nextElement() {
				return this.internalIt.next();
			} // end nextElement()
		} // end new
		;
	}
120338
@Override
    public Enumeration<URL> findResources(final String name) throws IOException {
        if (name == null) {
            return null;
        }
        // On iOS, every resource is resolved by the SystemClassLoader, so
        // any URL in this class loader will, too.
        return Collections.enumeration(urls);
    }
975717
public Optional<URL> getServiceUrl(String name) {
        Service service = client.services().inNamespace(namespace).withName(name).get();
        return service != null ? createUrlForService(service) : Optional.empty();
    }
1218226
public static Enumeration<URL> getResources(String resource) {
        Enumeration<URL> urls = null;
        try {
            urls = ClassUtils.getContextClassLoader().getResources(resource);
        } catch (IOException e) {
            //noop
        }
        if (urls == null) {
            try {
                urls = IOUtils.class.getClassLoader().getResources(resource);
            } catch (IOException e) {
                //noop
            }
        }

        if (urls == null) {
            URL url = IOUtils.class.getResource(resource);
            if (url != null) {
                final Iterator<URL> it = Lists.newArrayList(url).iterator();
                urls = new Enumeration<URL>() {
                    public boolean hasMoreElements() {
                        return it.hasNext();
                    }

                    public URL nextElement() {
                        return it.next();
                    }
                };
            }
        }

        if (urls == null) {
            File file = new File(resource);
            if (file.isFile()) {
                try {
                    final Iterator<URL> it = Lists.newArrayList(file.toURI().toURL()).iterator();
                    urls = new Enumeration<URL>() {
                        public boolean hasMoreElements() {
                            return it.hasNext();
                        }

                        public URL nextElement() {
                            return it.next();
                        }
                    };
                } catch (MalformedURLException e) {
                    //no op
                }
            }
        }

        return urls == null ? new Enumeration<URL>() {
            public boolean hasMoreElements() {
                return false;
            }

            public URL nextElement() {
                return null;
            }
        } : urls;
    }
1254860
public static List<String> getResourceLines(String resourceName) throws IOException {
        InputStreamReader isreader = null;
        BufferedReader reader = null;
        try {
            isreader = new InputStreamReader(Util.class.getResourceAsStream(resourceName));
            reader = new BufferedReader(isreader);
            List<String> lines = new ArrayList<String>();
            String tmp;
            while ((tmp = reader.readLine()) != null) {
                lines.add(tmp);
            }
            return lines;
        } finally {
            closeQuietly(reader);
            closeQuietly(isreader);
        }
    }
1315185
public void addNameUrl(final String name, final String url) 
	throws IOException {
		
		// need to first see if there is already an entry for this name.
		// if not, add url as the value.
		// if so, check the current url locations for name
		//     if url exists, do nothing
		//     if url does not exist, add, and set that as the value.
		
		String newValue = null;
		String oldValue = get(name);
		if(oldValue != null && oldValue.length() > 0) {
			String curUrls[] = oldValue.split(urlDelimiterRE);
			boolean found = false;
			for(int i=0; i < curUrls.length; i++) {
				if(url.equals(curUrls[i])) {
					found = true;
					break;
				}
			}
			if(found == false) {
				newValue = oldValue + " " + url;
			}
		} else {
			// null or empty value
			newValue = url;
			if(oldValue == null) log.addName(name);
		}
		
		// did we find a value?
		if(newValue != null) {
			put(name,newValue);
		}
	}
1191534
@Override
  public Iterator<ResourceRecordSet<?>> iterateByName(String name) {
    Filter<ResourceRecordSet<?>> filter = andNotAlias(nameEqualTo(name));
    return lazyIterateRRSets(api.listResourceRecordSets(zoneId, name), filter);
  }