Class WebArchiveReader

java.lang.Object
io.goobi.viewer.model.media.webarchives.WebArchiveReader

public final class WebArchiveReader extends Object
  • Method Details

    • getSeedUrl

      public static String getSeedUrl(String pi)
      Returns the seed URL from the first WACZ file indexed for the given PI, or an empty string if no seed page is found.

      If local WACZ files are indexed, their pages/pages.jsonl is read for the first seed:true URL. Only when no local archive documents exist does this fall back to the url parameter of an external MD_WEBARCHIVE_IDENTIFIER.

      Parameters:
      pi - persistent identifier of the record
      Returns:
      the resolved seed URL, or "" if none is found or the lookup fails
    • extractParamValue

      public static String extractParamValue(String rawParams, String paramName)
      Looks up the value of a named parameter in a raw &-delimited parameter string, such as a URI's query or fragment component.
      Parameters:
      rawParams - raw parameter string, e.g. uri.getRawQuery() or uri.getRawFragment()
      paramName - name of the parameter to look up
      Returns:
      the parameter's decoded value, or null if rawParams is null or has no such parameter
    • readSeedUrlFromWacz

      public static String readSeedUrlFromWacz(Path waczPath) throws IOException
      Reads the first seed URL from the pages/pages.jsonl entry inside a WACZ file.
      Throws:
      IOException