String resourceValue = attributeValue;
Expression expression = StandardExpressionProcessor.parseExpression(arguments, attributeValue);
if (!(expression instanceof LinkExpression)) {
throw new TemplateProcessingException("Could not parse as expression: \"" + attributeValue + "\"");
}
String linkBase = getExpressionBaseUrl((LinkExpression) expression);
if (!StringUtils.hasText(linkBase)) {
throw new TemplateProcessingException("Could not parse as expression: \"" + attributeValue + "\"");
}
if(staticContentURL != null && !staticContentURL.isEmpty() && !"${CloudFrontURL}".equals(staticContentURL)) {
resourceValue = staticContentURL + linkBase;
} else {
String processedPath;
try {
processedPath = (String) StandardExpressionProcessor.processExpression(arguments, attributeValue);
} catch (Exception e) {
throw new TemplateProcessingException("Could not parse as expression: \"" + attributeValue + "\"");
}
if (StringUtils.hasText(processedPath)) {
resourceValue = processedPath;
}