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)
ResourceCache
isCached
in interface ResourceCache
resourceId
- The resourceIdpublic byte[] read(java.lang.String resourceId)
ResourceCache
read
in interface ResourceCache
resourceId
- the resource id.public java.lang.String toString()
toString
in class java.lang.Object
public void write(java.lang.String resourceId, byte[] data) throws java.io.IOException
ResourceCache
write
in interface ResourceCache
resourceId
- the resource id, never null
.data
- the datajava.io.IOException
- when an IO error occurs.