Java Resource Find findResources(String name)

Here you can find the source of findResources(String name)

Description

find Resources

License

Open Source License

Declaration

public static List<URL> findResources(String name) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;

import java.net.URL;

import java.util.*;

public class Main {
    public static List<URL> findResources(String name) {
        try {//from   www  . ja  va  2s.c  o  m
            Enumeration<URL> resources = Thread.currentThread().getContextClassLoader().getResources(name);
            List<URL> ret = new ArrayList<URL>();
            while (resources.hasMoreElements()) {
                ret.add(resources.nextElement());
            }
            return ret;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. findResource(Class clazz)
  2. findResource(String name)
  3. findResource(String resource, ClassLoader classLoader)
  4. findResourceBase(String baseResource, ClassLoader loader)
  5. findResourceBases(String baseResource, ClassLoader loader)