Package org.openjdk.jmc.test.io
Class ResourceResource
java.lang.Object
org.openjdk.jmc.test.io.ResourceResource
- All Implemented Interfaces:
IOResource
An IO resource that is loaded from a Java resource.
-
Constructor Summary
ConstructorsConstructorDescriptionResourceResource(Class<?> clazz, String name) ResourceResource(Class<?> clazz, String directory, String name) -
Method Summary
-
Constructor Details
-
ResourceResource
- Parameters:
clazz- use the class loader of this class to load the resourcename- resource name
-
ResourceResource
- Parameters:
clazz- use the class loader of this class to load the resourcedirectory- resource directory namename- resource name relative to directory
-
-
Method Details
-
open
Description copied from interface:IOResourceOpens a stream that can be used to read the contents of the resource. Relies on caller to close the stream.- Specified by:
openin interfaceIOResource- Returns:
- an
InputStream - Throws:
IOException
-
close
public void close()Description copied from interface:IOResourceCloses whatever resources are not closed by caller to open.- Specified by:
closein interfaceIOResource
-
getName
Description copied from interface:IOResourceThe name of the resource.- Specified by:
getNamein interfaceIOResource- Returns:
- the name
-