Class WebArchiveReader
java.lang.Object
io.goobi.viewer.model.media.webarchives.WebArchiveReader
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringextractParamValue(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.static StringgetSeedUrl(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.static StringreadSeedUrlFromWacz(Path waczPath) Reads the first seed URL from thepages/pages.jsonlentry inside a WACZ file.
-
Method Details
-
getSeedUrl
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.jsonlis read for the firstseed:trueURL. Only when no local archive documents exist does this fall back to theurlparameter of an externalMD_WEBARCHIVE_IDENTIFIER.- Parameters:
pi- persistent identifier of the record- Returns:
- the resolved seed URL, or
""if none is found or the lookup fails
-
extractParamValue
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()oruri.getRawFragment()paramName- name of the parameter to look up- Returns:
- the parameter's decoded value, or
nullifrawParamsisnullor has no such parameter
-
readSeedUrlFromWacz
Reads the first seed URL from thepages/pages.jsonlentry inside a WACZ file.- Throws:
IOException
-