- result.put(Category.SPORT,
- new String[] { "http://www.france24.com/fr/sports/rss" });
+ synchronized (articlesByCategory) {
+ result = articlesByCategory.get(cat);
+ if (result == null) {
+ result = new ArrayList<>();
+ articlesByCategory.put(cat, result);
+ }
+ return result;
+ }
+ }
+
+ private boolean exists(String articleLink, List<Article> articles) {
+ synchronized (articles) {
+ for (Article a: articles)
+ if (a.link.equals(articleLink))
+ return true;
+ }
+ return false;
+ }
+
+ private static Article toArticle(String link, SyndEntry entry, SyndFeed feed) {
+ String desc, title, thumbnail, feedTitle, str;
+ Date date;