Class CdxWriter
java.lang.Object
org.netpreserve.jwarc.cdx.CdxWriter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidSets a handler for warnings emitted during processing.voidProcesses a list of WARC files writing CDX records for each response or resource record.voidprocess(WarcReader reader, String filename) Writes CDX records for each response or resource record in a WARC file.voidSets the CDX output format to use.voidsetPostAppend(boolean postAppend) Appends an encoded version of the request to the URL key for POST and PUT requests.voidsetRecordFilter(Predicate<WarcRecord> recordFilter) Records that don't match this filter will not be emitted.voidwrite(WarcCaptureRecord capture, String filename, long position, long length) Writes a CDX record.voidwrite(WarcCaptureRecord capture, String filename, long position, long length, String encodedRequest) Writes a CDX record with an encoded request body appended to the urlkey field.voidWrites a CDX header line.
-
Constructor Details
-
CdxWriter
-
-
Method Details
-
writeHeaderLine
-
write
public void write(WarcCaptureRecord capture, String filename, long position, long length) throws IOException Writes a CDX record.- Throws:
IOException
-
write
public void write(WarcCaptureRecord capture, String filename, long position, long length, String encodedRequest) throws IOException Writes a CDX record with an encoded request body appended to the urlkey field.- Throws:
IOException- See Also:
-
process
Processes a list of WARC files writing CDX records for each response or resource record.- Throws:
IOException
-
process
Writes CDX records for each response or resource record in a WARC file.- Throws:
IOException
-
setRecordFilter
Records that don't match this filter will not be emitted. Accepts all records if null. -
setFormat
-
setPostAppend
public void setPostAppend(boolean postAppend) Appends an encoded version of the request to the URL key for POST and PUT requests. -
onWarning
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-