String name = "default";
if (url.length() > PROTOCOL.length()) {
String suffix = url.substring(PROTOCOL.length());
String linkUri = "lenya-document:" + suffix;
try {
Link link = getLink(linkUri, pubId, area);
LinkTarget target = IconUrlTransformer.this.linkResolver.resolve(
IconUrlTransformer.this.factory, link.getUri());
if (target.exists()) {
Document doc = target.getDocument();
ResourceType type = doc.getResourceType();
if (Arrays.asList(type.getFormats()).contains("icon")) {
name = type.getName();