public byte[] getFeedIcon(URI link, IProgressMonitor monitor) {
return loadFavicon(link, false, monitor);
}
private void interpretFrom(INews news, String value) {
IPerson person = Owl.getModelFactory().createPerson(null, news);
value = value.trim();
/* Complex value */
if (value.contains(" ")) { //$NON-NLS-1$
/* Remove quotes first */
value = value.replace("\"", ""); //$NON-NLS-1$//$NON-NLS-2$
value = value.replace("'", ""); //$NON-NLS-1$ //$NON-NLS-2$
/* foo@bar.com (Forename Name) */
if (value.contains("(") && value.contains(")")) { //$NON-NLS-1$ //$NON-NLS-2$
int start = value.indexOf('(');
int end = value.indexOf(')');
/* E-Mail */
if (start > 0)
person.setEmail(URIUtils.createURI(value.substring(0, start)));
/* Name */
if (start < end)
person.setName(value.substring(start + 1, end).trim());
}
/* Forename Name <foo@bar.com> */
if (value.contains("<") && value.contains(">")) { //$NON-NLS-1$ //$NON-NLS-2$
int start = value.indexOf('<');
int end = value.indexOf('>');
/* Name */
if (start > 0)
person.setName(value.substring(0, start).trim());
/* E-Mail */
if (start < end)
person.setEmail(URIUtils.createURI(value.substring(start + 1, end)));
}
}
/* Simple Value (EMail) */
else if (value.contains("@")) //$NON-NLS-1$
person.setEmail(URIUtils.createURI(value));
/* Simple Value (Name) */
else
person.setName(value);
news.setAuthor(person);
}