throws IOException
{
Object[] parameters = getParameters(cycle);
if (Tapestry.size(parameters) != 2)
throw new ApplicationRuntimeException(
Tapestry.format("service-incorrect-parameter-count", Tapestry.ASSET_SERVICE, new Integer(2)));
String resourcePath = (String) parameters[0];
String checksum = (String) parameters[1];
URL resourceURL = engine.getResourceResolver().getResource(resourcePath);
if (resourceURL == null)
throw new ApplicationRuntimeException(
Tapestry.format("missing-resource", resourcePath));
String actualChecksum = engine.getResourceChecksumSource().getChecksum(resourceURL);
if (!actualChecksum.equals(checksum))
{
throw new ApplicationRuntimeException(
Tapestry.format("AssetService.checksum-failure", checksum, resourcePath));
}
URLConnection resourceConnection = resourceURL.openConnection();