Java Resource File loadAutoConfigFiles(ClassLoader classLoader, String resourceName)

Here you can find the source of loadAutoConfigFiles(ClassLoader classLoader, String resourceName)

Description

load Auto Config Files

License

Open Source License

Declaration

protected static List<URL> loadAutoConfigFiles(ClassLoader classLoader,
            String resourceName) 

Method Source Code

//package com.java2s;
/*//from  w  ww . ja  v a 2s. c o  m
 * Copyright 2011-2016 ZXC.com All right reserved. This software is the confidential and proprietary information of
 * ZXC.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into with ZXC.com.
 */

import java.io.IOException;

import java.net.URL;

import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;

public class Main {
    protected static List<URL> loadAutoConfigFiles(ClassLoader classLoader,
            String resourceName) {
        try {
            List<URL> urlList = new ArrayList<URL>();
            Enumeration<URL> urls = classLoader.getResources(resourceName);

            for (; urls.hasMoreElements();) {
                URL url = urls.nextElement();
                urlList.add(url);
            }
            return urlList;
        } catch (IOException e) {
            return new ArrayList<URL>();
        }
    }
}

Related

  1. getSourceForResource(String s)
  2. getStreamFromResource(Class clazz, String resourceName)
  3. getTestResourceFile(String pName, Class pClass)
  4. inputStream(Class baseClass, String resourceName)
  5. isFullIRI(String resource)
  6. loadConfigFile(String resource, Class clazz)
  7. loadUTF8(String resource)
  8. openInputStream(String resourceString, ClassLoader classLoader)
  9. parseASX(String inputResource)