rome upgrade

This commit is contained in:
Athou
2014-08-15 13:51:13 +02:00
parent 20292a7742
commit fa0e7bcb54
15 changed files with 81 additions and 111 deletions

View File

@@ -10,9 +10,9 @@ import com.commafeed.backend.dao.FeedSubscriptionDAO;
import com.commafeed.backend.model.FeedCategory;
import com.commafeed.backend.model.FeedSubscription;
import com.commafeed.backend.model.User;
import com.sun.syndication.feed.opml.Attribute;
import com.sun.syndication.feed.opml.Opml;
import com.sun.syndication.feed.opml.Outline;
import com.rometools.opml.feed.opml.Attribute;
import com.rometools.opml.feed.opml.Opml;
import com.rometools.opml.feed.opml.Outline;
@AllArgsConstructor
public class OPMLExporter {
@@ -20,7 +20,6 @@ public class OPMLExporter {
private final FeedCategoryDAO feedCategoryDAO;
private final FeedSubscriptionDAO feedSubscriptionDAO;
@SuppressWarnings("unchecked")
public Opml export(User user) {
Opml opml = new Opml();
opml.setFeedType("opml_1.1");
@@ -48,7 +47,6 @@ public class OPMLExporter {
}
@SuppressWarnings("unchecked")
private Outline buildCategoryOutline(FeedCategory cat, List<FeedSubscription> subscriptions) {
Outline outline = new Outline();
outline.setText(cat.getName());
@@ -66,7 +64,6 @@ public class OPMLExporter {
return outline;
}
@SuppressWarnings("unchecked")
private Outline buildSubscriptionOutline(FeedSubscription sub) {
Outline outline = new Outline();
outline.setText(sub.getTitle());

View File

@@ -5,7 +5,7 @@ import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import com.commafeed.backend.cache.CacheService;
@@ -15,9 +15,9 @@ import com.commafeed.backend.model.FeedCategory;
import com.commafeed.backend.model.User;
import com.commafeed.backend.service.FeedSubscriptionService;
import com.commafeed.backend.service.FeedSubscriptionService.FeedSubscriptionException;
import com.sun.syndication.feed.opml.Opml;
import com.sun.syndication.feed.opml.Outline;
import com.sun.syndication.io.WireFeedInput;
import com.rometools.opml.feed.opml.Opml;
import com.rometools.opml.feed.opml.Outline;
import com.rometools.rome.io.WireFeedInput;
@Slf4j
public class OPMLImporter {
@@ -33,7 +33,6 @@ public class OPMLImporter {
this.cache = cache;
}
@SuppressWarnings("unchecked")
public void importOpml(User user, String xml) {
xml = xml.substring(xml.indexOf('<'));
WireFeedInput input = new WireFeedInput();
@@ -49,7 +48,6 @@ public class OPMLImporter {
}
@SuppressWarnings("unchecked")
private void handleOutline(User user, Outline outline, FeedCategory parent) {
List<Outline> children = outline.getChildren();
if (CollectionUtils.isNotEmpty(children)) {