diff --git a/.github/README-template.md b/.github/README-template.md index 904e720..34675d3 100644 --- a/.github/README-template.md +++ b/.github/README-template.md @@ -44,12 +44,20 @@ List footballArticles = rssFeed.filter(i -> i.getTitle().equals(Optional.o ``` ### Read feed from a file +Reading from file using InputStream ```java -InputStream file = new FileInputStream("Path to file"); -List items = new RssReader().read(file); +InputStream inputStream = new FileInputStream("/path/to/file"); +List items = new RssReader().read(inputStream); .toList(); ``` +Reading from file using file URI +```java +List items = new RssReader().read("file:/path/to/file"); + .toList(); +``` + + ### Read from multiple feeds Read from multiple feeds into a single stream of items sored in descending (newest first) publication date order and prints the title. ```java @@ -62,7 +70,12 @@ new RssReader().read(urls) To change sort order to ascending (oldest first) publication date ```java -.sorted(ItemComparator.oldestItemFirst()) +.sorted(ItemComparator.oldestPublishedItemFirst()) +``` +For sorting on updated date instead of publication date +```java +.sorted(ItemComparator.newestUpdatedItemFirst()) +.sorted(ItemComparator.oldestUpdatedItemFirst()) ```