Skip to content

Commit d1dc0e2

Browse files
committed
Add ViewTool for interactive WARC file exploration
1 parent 9c7f17b commit d1dc0e2

File tree

4 files changed

+426
-0
lines changed

4 files changed

+426
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ Create a CDX file:
116116

117117
java -jar jwarc.jar cdx example.warc > records.cdx
118118

119+
List, filter and extract captures with an interactive terminal interface:
120+
121+
java -jar jwarc.jar view example.warc
122+
119123
Run a replay proxy and web server:
120124

121125
export PORT=8080

src/org/netpreserve/jwarc/WarcCaptureReader.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,20 @@ WarcCaptureRecord readConcurrentTo(ConcurrentRecordSet concurrentSet) throws IOE
8686
return null;
8787
}
8888

89+
/**
90+
* Seeks to the record at the given position in the underlying channel.
91+
*
92+
* @param position byte offset of the beginning of the record to seek to
93+
* @throws IOException if an I/O error occurs
94+
* @throws IllegalArgumentException if the position is negative
95+
* @throws UnsupportedOperationException if the underlying channel does not support seeking
96+
*/
97+
public void position(long position) throws IOException {
98+
reader.position(position);
99+
nextRecord = null;
100+
warcinfo = null;
101+
}
102+
89103
/**
90104
* Closes the underlying WarcReader.
91105
* @throws IOException if an I/O error occurs during the close operation.

0 commit comments

Comments
 (0)