The <ISRESOURCE> is similar to the <ISFILE> tag, but can be used outside of an <ISFILEBUNDLE> tag.
Sometimes, you need to use the attributes of a FileResource, like LastModified. In these cases, you can easily create a resource with the <ISRESOURCE> tag.
<isResource file = "{relative target path}" [name = "{name of the FileResource in the pipeline-dictionary}"]>
<isresource file="aPath/aFileRef.css" name="TheFile">
Puts a FileResource for aPath/aFileRef.css under the name TheFile
into the pipeline dictionary.
<isresource file="aPath/aFileRef.css">
Puts a FileResource for aPath/aFileRef.css under the name Resource
into the pipeline dictionary.
The file attribute is required.
It must contain the relative path to an file.
The name attribute is optional.
It contains the name of the created FileResource for the later usage. If no name is given, FILERES will be the name of the FileResource.
The resource is the implementation of the interface com.intershop.beehive.core.capi.resource.Resource
.
/** * This is an abstract resource which can be an array of bytes or file on the * file system specified through a relative path. */ public interface Resource { /** * Returns the name of this resource. If the resource is a file, this is the * relative path of resource file. * * @return * the name of the resource */ public String getName(); /** * Returns date of the last modification of this resource. If the resource * is a file, this method accessed the file system. * * @return * the date of the last modification */ public long getLastModified(); /** * Returns true if there is data behind this resource. * For example, a file-resource would return true if the file exists, and false if not. * @return false if there is no data present for this resource. */ public boolean exists(); /** * Returns the same then the method exist. But the signature will be found by the isml-lookup. * @see Resource#exists() * @return false if the underlying resource does not exist. */ default public boolean getDoExist() { return exists(); } }
The resource has the here important methods getName(), getLastModified()
and getDoExist()
.
<isresource file="/css/test.css" name="TheFile"> <isprint value="#TheFile:Name#"> <isprint value="#TheFile:DoExist#"> <isprint value="#TheFile:LastModified#">