}
public static String urlForResourceNamed (AWRequestContext requestContext, String name, boolean useFullURL)
{
Assert.that(!StringUtil.nullOrEmptyOrBlankString(name), "Unable to provide url for null/empty/blank resource");
AWResourceManager resourceManager = resourceManager(requestContext);
AWResource res = resourceManager.resourceNamed(name);
if (!(res instanceof AWFileResource)) {
boolean useFullUrl = requestContext.isMetaTemplateMode();
boolean isSecure = useFullUrl ? requestContext.request() != null && requestContext.request().isSecureScheme() : false;
return resourceManager.urlForResourceNamed(name, useFullUrl, isSecure, false);
}
String path = ((AWFileResource)res)._fullPath();
Assert.that(path.endsWith(name), "Resource %s resolved to file path %s, which does not end with the requested resource!", name, path);