Package org.apache.rat.test.utils
Class Resources
java.lang.Object
org.apache.rat.test.utils.Resources
Utility class, which provides static methods for creating test cases.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedReadergetBufferedReader(File file) Locates a resource file in the classpath and returns aBufferedReader.static FilegetExampleResource(String pResource) Locates a file in the unpacked example data archive.static FilegetResourceDirectory(String pResource) Locates a test resource directory in the classpath.static FilegetResourceFile(String pResource) Locates a test resource file in the classpath.static File[]getResourceFiles(String pResource) Locates a set of resource files in the class path.static ReadergetResourceReader(String pResource) Locates a resource file in the classpath and returns aReader.static InputStreamgetResourceStream(String pResource) Locates a resource file in the classpath and returns anInputStream.
-
Field Details
-
SRC_TEST_RESOURCES
- See Also:
-
SRC_MAIN_RESOURCES
- See Also:
-
-
Method Details
-
getResourceFile
Locates a test resource file in the classpath.- Throws:
IOException
-
getResourceDirectory
Locates a test resource directory in the classpath.- Throws:
IOException
-
getExampleResource
Locates a file in the unpacked example data archive.- Parameters:
pResource- the name of the resource to find.- Returns:
- the File for the resource.
- Throws:
URISyntaxException- in case of path I/O errors with the given resource.
-
getResourceFiles
Locates a set of resource files in the class path. In case of errors try to add module names to fix behaviour from within IntelliJ.- Throws:
IOException
-
getResourceStream
Locates a resource file in the classpath and returns anInputStream.- Throws:
IOException
-
getResourceReader
Locates a resource file in the classpath and returns aReader.- Throws:
IOException
-
getBufferedReader
Locates a resource file in the classpath and returns aBufferedReader.- Throws:
IOException
-