Here you can find the source of getResources(ClassLoader cl, String resourcePath)
Parameter | Description |
---|---|
cl | a parameter |
resourcePath | a parameter |
private static Enumeration<URL> getResources(ClassLoader cl, String resourcePath)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010 Angelo Zerr and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors://from w w w .ja v a 2s .c om * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation *******************************************************************************/ import java.io.IOException; import java.net.URL; import java.util.Enumeration; public class Main { /** * Returns a resources founded from the ClassLoader. * * @param cl * @param resourcePath * @return */ private static Enumeration<URL> getResources(ClassLoader cl, String resourcePath) { try { return cl == null ? ClassLoader.getSystemResources(resourcePath) : cl.getResources(resourcePath); } catch (IOException e) { e.printStackTrace(); } return null; } }