Package com.sun.syndication.io

Examples of com.sun.syndication.io.XmlReader


            DateFormat dateFormatter = DateFormat.getDateTimeInstance();
            Date timestamp = dateFormatter.parse(lastchecktimestamp);
           
            // get the feed data from the supplied address           
            SyndFeedInput input = new SyndFeedInput();
            SyndFeed feed = input.build(new XmlReader(new URL(rssaddress)));
            //System.out.println(feed);
           
            // check all the items to see if we have seen them before
            List entries = feed.getEntries();
            for(Object entry: entries){
View Full Code Here


                feedURL = new URL(uri);
            }

            // Read the configured feed into a Feed object
            SyndFeedInput input = new SyndFeedInput();
            SyndFeed feed = input.build(new XmlReader(feedURL));
            msg.setBody(feed);

            System.out.println(">>> FeedBindingInvoker (" + feed.getFeedType() + ") " + uri);
           
        } catch (MalformedURLException e) {
View Full Code Here

        try {
            logger.fine("invoke " + uri);

            // Read an RSS feed into a Synd feed
            SyndFeedInput input = new SyndFeedInput();
            SyndFeed feed = input.build(new XmlReader(new URL(uri)));
           
            //FIXME Support conversion to data-api entries
           
            msg.setBody(feed);
View Full Code Here

public class RssUtil {
  public static Feed createFeed(String feedUrl) throws OtroException {
    SyndFeedInput input = new SyndFeedInput();
    SyndFeed feed = null;
    try {
      feed = input.build(new XmlReader(new URL(feedUrl)));
    } catch (Exception e) {
      MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Load Error", "Unable to load "
          +feedUrl+" ("+e.getMessage()+")");
     
    }
View Full Code Here

    protected SyndFeed loadOrCreateFeed() throws IllegalArgumentException, FeedException, IOException {
        if (isLoadOnStartup()) {
            File file = getFeedFile();
            if (file.exists() && file.isFile()) {
                SyndFeedInput input = new SyndFeedInput();
                XmlReader xmlReader = new XmlReader(file);
                return input.build(xmlReader);
            }
        }
        return createFeed();
    }
View Full Code Here

        SyndFeedInput input = new SyndFeedInput();
        for (int i = 0;i < urls.size();i++) {
            URL inputUrl = (URL) urls.get(i);
            SyndFeed inFeed;
            try {
                inFeed = input.build(new XmlReader(inputUrl));
                List entries = inFeed.getEntries();
                for (int k = 0;k < entries.size();k++) {
                    SyndEntry entry = (SyndEntry) entries.get(k);
                    if (entry.getPublishedDate().after(getLastPolledDate())) {
                        result.add(entry);
View Full Code Here

     
    public List parse(String url, int size) throws Exception {
        List entries = new ArrayList();
        URL feedSource = new URL(url);
        SyndFeedInput input = new SyndFeedInput();
        SyndFeed feed = input.build(new XmlReader(feedSource));
        int i = 0;
       
        for(Object f : feed.getEntries()) {
            if(i == size)
                break;
View Full Code Here

                int status = getMethod.getStatusCode();

                // Read the Atom feed
                if (status == 200) {
                    WireFeedInput input = new WireFeedInput();
                    Feed feed = (Feed)input.build(new XmlReader(getMethod.getResponseBodyAsStream()));
                    msg.setBody(feed);

                } else if (status == 404) {
                    msg.setFaultBody(new NotFoundException());
                } else {
View Full Code Here

  {
    SyndFeedInput sfi = new SyndFeedInput();
    SyndFeed feed;
   
    try {
      feed = sfi.build(new XmlReader(feedUrl));
    } catch (IllegalArgumentException e) {
      throw new UpdateException("Unknown type of update feed", e);
    } catch (FeedException e) {
      throw new UpdateException("Error while parsing update feed", e);
    } catch (IOException e) {
View Full Code Here

    private static String load(List<SyndEntry> entries, String url, String watermark, int limit) throws IOException, FeedException {
        String lastWatermark = null;
        SyndFeedInput feedInput = new SyndFeedInput();

        SyndFeed feed = feedInput.build(new XmlReader(new URL(url)));

        int max = limit > 0 ? Math.min(feed.getEntries().size(), limit) : feed.getEntries().size();
        for (int i = 0; i < max; ++i) {
            SyndEntry entry = (SyndEntry) feed.getEntries().get(i);
View Full Code Here

TOP

Related Classes of com.sun.syndication.io.XmlReader

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.