/** If the url is a valid reference, convert it to a URL, else return it unchanged. */ protected String convertReferenceUrl(String url) { // make a reference Reference ref = EntityManager.newReference(url); // if it didn't recognize this, return it unchanged if (ref.isKnownType()) { // return the reference's url String refUrl = ref.getUrl(); if (refUrl != null) { return refUrl; } } return url; }