Skip to content

Commit c90fbcd

Browse files
committed
#11 - Updated the readme with the reactive changes.
1 parent 8c1c538 commit c90fbcd

File tree

2 files changed

+36
-7
lines changed

2 files changed

+36
-7
lines changed

README.md

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ These are basic usage examples for the library. When the library was created the
1212

1313
Stream a WARC file from an URL and print the payload (response body) to the console.
1414

15-
```
15+
```java
1616
final URL warcUrl = new URL(
1717
"https://commoncrawl.s3.amazonaws.com/crawl-data/CC-MAIN-2018-43/segments/1539583508988.18/warc/CC-MAIN-20181015080248-20181015101748-00000.warc.gz");
1818

@@ -26,7 +26,7 @@ WarcRecordStreamFactory.streamOf(warcUrl)
2626

2727
Read WARC records from a file one by one using the WarcReader class.
2828

29-
```
29+
```java
3030
final WarcReader warcReader = new WarcReader(new FileInputStream(
3131
new File("C:\\warc-test\\CC-MAIN-20180716232549-20180717012549-00001.warc.gz")));
3232

@@ -48,20 +48,49 @@ while (hasNext) {
4848
}
4949
```
5050

51+
### Reactive extensions
52+
53+
If you want a Flux of WarcRecords you should use the reactive module like:
54+
55+
```java
56+
final URL warcUrl = new URL(
57+
"https://commoncrawl.s3.amazonaws.com/crawl-data/CC-MAIN-2018-43/segments/1539583508988.18/warc/CC-MAIN-20181015080248-20181015101748-00000.warc.gz");
58+
59+
WarcRecordFluxFactory.buildWarcRecordFlux(warcUrl)
60+
.filter(WarcRecord::isResponse)
61+
.map(entry -> ((ResponseContentBlock) entry.getWarcContentBlock()).getPayloadAsString())
62+
...
63+
```
64+
5165
### Installation
5266

5367
The library is available in maven central.
5468

5569
You can use it with maven:
56-
```
70+
```xml
5771
<dependency>
5872
<groupId>com.github.bottomless-archive-project</groupId>
5973
<artifactId>java-warc</artifactId>
60-
<version>1.0.0</version>
74+
<version>1.2.0</version>
75+
</dependency>
76+
```
77+
78+
Or gradle:
79+
```groovy
80+
implementation 'com.github.bottomless-archive-project:java-warc:1.2.0'
81+
```
82+
83+
If you want to use the reactive module use you can use it with maven:
84+
85+
```xml
86+
<dependency>
87+
<groupId>com.github.bottomless-archive-project</groupId>
88+
<artifactId>java-warc-reactive</artifactId>
89+
<version>1.2.0</version>
6190
</dependency>
6291
```
6392

6493
Or gradle:
94+
```groovy
95+
implementation 'com.github.bottomless-archive-project:java-warc-reactive:1.2.0'
6596
```
66-
implementation 'com.github.bottomless-archive-project:java-warc:1.0.0'
67-
```

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group=com.github.bottomless-archive-project
2-
version=1.1.0
2+
version=1.2.0
33
name=Java WARC
44
description=A WARC file reader and parser written in Java.
55
ossrhUsername=

0 commit comments

Comments
 (0)