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 |
|---|---|
void |
addResource(Resource resource) |
Resource |
addResource(String fileName,
byte[] data) |
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)
null@Nullable public Resource addResource(String fileName, String data)
data - The text to store (in platform default encoding)nullpublic void addResource(Resource resource)
public Collection<Resource> resources()
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 © 2019. All rights reserved.