if (resource == null) {
return RES_NOT_FOUND;
}
if (dataURI && resource.getContentType().startsWith("image")) {
resource = new GraphicResource(resource.getInputStream(), resource.getContentType());
}
}
else {
ValueExpression value = getValueExpression("value");
if (value == null) {
throw new IllegalArgumentException(ERROR_MISSING_VALUE);
}
if (dataURI) {
resource = new GraphicResource(value.getValue(context.getELContext()), null);
}
else {
resource = GraphicResource.create(context, value, getAttributes().get("lastModified"));
}
}