public byte[] getFeedIcon(URI link) {
return loadFavicon(link, false);
}
private void interpretFrom(INews news, String value) {
IPerson person = Owl.getModelFactory().createPerson(null, news);
value = value.trim();
/* Complex value */
if (value.contains(" ")) {
/* Remove quotes first */
value = value.replace("\"", "");
value = value.replace("'", "");
/* foo@bar.com (Forename Name) */
if (value.contains("(") && value.contains(")")) {
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(">")) {
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("@"))
person.setEmail(URIUtils.createURI(value));
/* Simple Value (Name) */
else
person.setName(value);
news.setAuthor(person);
}