public abstract class ResourceFinder extends Object
Notice that there is a symmetrical concept ResourceCreator
that creates resources for writing.
Modifier and Type | Field and Description |
---|---|
static ListableResourceFinder |
EMPTY_RESOURCE_FINDER
This one's useful when a resource finder is required, but cannot be created for some reason.
|
Constructor and Description |
---|
ResourceFinder() |
Modifier and Type | Method and Description |
---|---|
abstract Resource |
findResource(String resourceName)
Finds a resource by name and return it as a
Resource object. |
InputStream |
findResourceAsStream(String resourceName)
Finds a resource by name and open it for reading.
|
public static final ListableResourceFinder EMPTY_RESOURCE_FINDER
@Nullable public final InputStream findResourceAsStream(String resourceName) throws IOException
resourceName
- Designates the resource; typically structured by slashes ("/") like
"com/foo/pkg/Bar.class
"null
if the resource could not be foundIOException
- The resource was found, but there are problems opening it@Nullable public abstract Resource findResource(String resourceName)
Resource
object.resourceName
- Designates the resource; typically structured by slashes ("/") like
"com/foo/pkg/Bar.class
"null
if the resource could not be foundCopyright © 2022. All rights reserved.