Content content = variant.getContent();
if (content instanceof EmbeddedContent) {
EmbeddedContent embedded = (EmbeddedContent) content;
return embedded.getData();
} else {
MarinerURL marinerURL = computeURL((Asset) selected.getOldObject());
// Then, convert it to an absolute URL
URL url;
try {
url = context.getAbsoluteURL(marinerURL);
} catch (MalformedURLException e) {
logger.warn("asset-mariner-url-retrieval-error",
new Object[]{
policy.getName(),
((marinerURL == null) ? "" :
marinerURL.getExternalForm())},
e);
return null;
}
// Finally, attempt to read out the URL's contents.