Class RssReader


  • public class RssReader
    extends java.lang.Object
    Class for reading RSS (Rich Site Summary) and Atom types of web feeds.
    • Constructor Summary

      Constructors 
      Constructor Description
      RssReader()  
      RssReader​(java.net.http.HttpClient httpClient)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.stream.Stream<Item> read​(java.lang.String url)
      Read RSS feed with the given URL.
      java.util.concurrent.CompletableFuture<java.util.stream.Stream<Item>> readAsync​(java.lang.String url)
      Read RSS feed asynchronous with the given URL.
      protected java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<java.io.InputStream>> sendAsyncRequest​(java.lang.String url)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RssReader

        public RssReader()
      • RssReader

        public RssReader​(java.net.http.HttpClient httpClient)
    • Method Detail

      • read

        public java.util.stream.Stream<Item> read​(java.lang.String url)
                                           throws java.io.IOException
        Read RSS feed with the given URL.
        Parameters:
        url - URL to RSS feed.
        Returns:
        Stream of items
        Throws:
        java.io.IOException - Fail to read url or its content
      • readAsync

        public java.util.concurrent.CompletableFuture<java.util.stream.Stream<Item>> readAsync​(java.lang.String url)
        Read RSS feed asynchronous with the given URL.
        Parameters:
        url - URL to RSS feed.
        Returns:
        Stream of items
      • sendAsyncRequest

        protected java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<java.io.InputStream>> sendAsyncRequest​(java.lang.String url)