public class DefaultResourceCache extends java.lang.Object implements ResourceCache
ResourceCache, using the local file system.| Constructor and Description |
|---|
DefaultResourceCache()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isCached(java.lang.String resourceId)
Allows to query if a resource with the given id is present within the
local cache.
|
byte[] |
read(java.lang.String resourceId)
Reads the given resource, identified by the resourceId, from the cache.
|
java.lang.String |
toString() |
void |
write(java.lang.String resourceId,
byte[] data)
Write the given byte array to the internal store and register it on the
given resource ID.
|
public boolean isCached(java.lang.String resourceId)
ResourceCacheisCached in interface ResourceCacheresourceId - The resourceIdpublic byte[] read(java.lang.String resourceId)
ResourceCacheread in interface ResourceCacheresourceId - the resource id.public java.lang.String toString()
toString in class java.lang.Objectpublic void write(java.lang.String resourceId,
byte[] data)
throws java.io.IOException
ResourceCachewrite in interface ResourceCacheresourceId - the resource id, never null.data - the datajava.io.IOException - when an IO error occurs.