Package net.sourceforge.pmd.util
Class ResourceLoader
- java.lang.Object
-
- net.sourceforge.pmd.util.ResourceLoader
-
public class ResourceLoader extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
TIMEOUT
-
Constructor Summary
Constructors Constructor Description ResourceLoader()
Constructor for ResourceLoader.ResourceLoader(java.lang.ClassLoader cl)
Constructor for ResourceLoader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStream
loadClassPathResourceAsStream(java.lang.String name)
java.io.InputStream
loadClassPathResourceAsStreamOrThrow(java.lang.String name)
java.io.InputStream
loadResourceAsStream(java.lang.String name)
Attempts to load the resource from file, a URL or the claspath
-
-
-
Method Detail
-
loadResourceAsStream
public java.io.InputStream loadResourceAsStream(java.lang.String name) throws RuleSetNotFoundException
Attempts to load the resource from file, a URL or the claspathCaller is responsible for closing the
InputStream
.- Parameters:
name
- The resource to attempt and load- Returns:
- InputStream
- Throws:
RuleSetNotFoundException
-
loadClassPathResourceAsStream
public java.io.InputStream loadClassPathResourceAsStream(java.lang.String name) throws java.io.IOException
- Throws:
java.io.IOException
-
loadClassPathResourceAsStreamOrThrow
public java.io.InputStream loadClassPathResourceAsStreamOrThrow(java.lang.String name) throws RuleSetNotFoundException
- Throws:
RuleSetNotFoundException
-
-