Package org.eclipse.higgins.rsse

Examples of org.eclipse.higgins.rsse.RssFeed


    }
    return originalTarget;
  }

  public RssFeed receiveFeed(String feedPath) throws IOException {
    RssFeed feed = null;
    final ISynchAsynchConnection connection = getConnection();
    synchronized (connection) {
      if (connection.isConnected()) {
        try {
          feed = FeedParser.parse((byte[]) connection.sendSynch(null, feedPath.getBytes()));
View Full Code Here


    final ID channelID = IDFactory.getDefault().createStringID("/reuters/worldNews/");
    // ID channelID = IDFactory.getDefault().createStringID("/feed.xml");
    final IMergeableChannel channel = channelContainer.createMergeableChannel(channelID, listener, new HashMap());
    if (channel instanceof FeedSharedObject) {
      // get remote feed (subscribed)
      final RssFeed remoteFeed = ((FeedSharedObject) channel).getFeed();
      // get local feed (published)
      final File feedFile = new File("feed.xml");
      RssFeed localFeed = RssFeed.load(feedFile);
      if (localFeed == null) {
        localFeed = new RssFeed(remoteFeed.getTitle(), remoteFeed.getLink(), remoteFeed.getDescription());
        localFeed.setVersion(RssVersion.RSS_2_0);
      }
      // merge remote feed with local one
      localFeed.merge(remoteFeed);
      // add a new item to feed
      localFeed.addItem(new RssItem("New Google Item", "This is a new item", "http://www.google.com"));
      // publish updated feed
      localFeed.save(feedFile);
      // print item titles
      final java.util.List items = localFeed.getItems();
      for (int i = 0; i < items.size(); i++) {
        System.out.println(" " + i + " " + ((RssItem) items.get(i)).getTitle());
      }
    }
    // remove the channel
View Full Code Here

TOP

Related Classes of org.eclipse.higgins.rsse.RssFeed

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.