net.sourceforge.pmd.util

Class ResourceLoader

public class ResourceLoader extends Object

BSD-style license; for more info see http://pmd.sourceforge.net/license.html
Method Summary
static InputStreamloadResourceAsStream(String name)
Method to find a file, first by finding it as a file (either by the absolute or relative path), then as a URL, and then finally seeing if it is on the classpath.
static InputStreamloadResourceAsStream(String name, ClassLoader loader)
Uses the ClassLoader passed in to attempt to load the resource if it's not a File or a URL

Method Detail

loadResourceAsStream

public static InputStream loadResourceAsStream(String name)
Method to find a file, first by finding it as a file (either by the absolute or relative path), then as a URL, and then finally seeing if it is on the classpath.

loadResourceAsStream

public static InputStream loadResourceAsStream(String name, ClassLoader loader)
Uses the ClassLoader passed in to attempt to load the resource if it's not a File or a URL