Class WarcRecorder.Builder

java.lang.Object
org.microproxy.warc.WarcRecorder.Builder
Enclosing class:
WarcRecorder

public static final class WarcRecorder.Builder extends Object
Options for WarcRecorder.
  • Method Details

    • prefix

      public WarcRecorder.Builder prefix(String prefix)
      File name prefix (default "microproxy").
      Parameters:
      prefix - the WARC file-name prefix
      Returns:
      this builder
    • maxFileSize

      public WarcRecorder.Builder maxFileSize(long bytes)
      Start a new file after this many bytes (default 1 GiB).
      Parameters:
      bytes - the file size in bytes at which to rotate to a new WARC file
      Returns:
      this builder
    • maxBodySize

      public WarcRecorder.Builder maxBodySize(long bytes)
      Record at most this much of each body (default 512 MiB).
      Parameters:
      bytes - the maximum bytes to record from each body
      Returns:
      this builder
    • compress

      public WarcRecorder.Builder compress(boolean compress)
      Gzip each record (default true).
      Parameters:
      compress - whether to gzip each WARC record
      Returns:
      this builder
    • software

      public WarcRecorder.Builder software(String software)
      The software field of the warcinfo records.
      Parameters:
      software - the software identification written to warcinfo records
      Returns:
      this builder
    • build

      public WarcRecorder build() throws IOException
      Creates the configured WARC recorder.
      Returns:
      the configured WARC recorder
      Throws:
      IOException - if the recording directory cannot be created