public class MapResourceFinder extends ListableResourceFinder
ResourceFinder that provides access to resource stored as
byte arrays in a Map.EMPTY_RESOURCE_FINDER| Constructor and Description |
|---|
MapResourceFinder() |
MapResourceFinder(Map<String,byte[]> map) |
| Modifier and Type | Method and Description |
|---|---|
Resource |
addResource(Resource resource)
Adds another
Resource, so that it can later be found with findResource(String), ResourceFinder.findResourceAsStream(String) and resources(). |
Resource |
addResource(String fileName,
byte[] data)
Adds another
Resource, so that it can later be found with findResource(String), ResourceFinder.findResourceAsStream(String) and resources(). |
Resource |
addResource(String fileName,
String data) |
Resource |
findResource(String resourceName)
Finds a resource by name and return it as a
Resource object. |
Iterable<Resource> |
list(String resourceNamePrefix,
boolean recurse) |
Collection<Resource> |
resources() |
void |
setLastModified(long lastModified) |
findResourceAsStream@Nullable public Resource addResource(String fileName, byte[] data)
Resource, so that it can later be found with findResource(String), ResourceFinder.findResourceAsStream(String) and resources().null@Nullable public Resource addResource(String fileName, String data)
data - The text to store (in platform default encoding)nullpublic Resource addResource(Resource resource)
Resource, so that it can later be found with findResource(String), ResourceFinder.findResourceAsStream(String) and resources().nullpublic Collection<Resource> resources()
addResource(Resource)public final void setLastModified(long lastModified)
lastModified - The return value of Resource.lastModified() for the next resources added@Nullable public final Resource findResource(String resourceName)
ResourceFinderResource object.findResource in class ResourceFinderresourceName - Designates the resource; typically structured by slashes ("/") like
"com/foo/pkg/Bar.class"null if the resource could not be foundCopyright © 2021. All rights reserved.