{
// We always create a new asset relative to an existing resource; the type of resource
// will jive with the type of asset returned. Path may start with a leading slash, which
// yields an absolute, not relative, path to the resource.
Resource assetResource = baseResource.getRelativeResource(path);
// Here's the thing; In Tapestry 3.0 and earlier, you could specify
// library path like /org/apache/tapestry/contrib/Contrib.library. In the new scheme
// of things, that should be "classpath:/org/apache/tapestry/contrib/Contrib.library".
// But to keep a lot of things from breaking, we'll kludgely allow that here.
if (assetResource.getResourceURL() == null && path.startsWith("/"))
return _classpathAssetFactory.createAbsoluteAsset(path, locale, location);
Resource localized = _localizer.findLocalization(assetResource, locale);
if (localized == null)
throw new ApplicationRuntimeException(AssetMessages.missingAsset(path, baseResource),
location, null);