Package de.frankmuenster.mahoe.utils
Class WebUtilsHtmlUnit
java.lang.Object
de.frankmuenster.mahoe.utils.WebUtilsHtmlUnit
Utility class for web methods
- Author:
- Frank Münster
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
getPdfAsByteArray
(org.htmlunit.html.HtmlAnchor link) Read the account statement PDF from an HTMLUnit anchor into a byte array.static boolean
webResponseIsJson
(org.htmlunit.WebResponse webResponse) Überprüft die Webantwort, ob der http Statuscode 200 ist und die Antwort im JSON-Format vorliegt.
-
Method Details
-
getPdfAsByteArray
public static byte[] getPdfAsByteArray(org.htmlunit.html.HtmlAnchor link) Read the account statement PDF from an HTMLUnit anchor into a byte array.- Parameters:
link
- the HMTLUnit anchor to the PDF- Returns:
- the PDF as byte array
-
webResponseIsJson
public static boolean webResponseIsJson(org.htmlunit.WebResponse webResponse) Überprüft die Webantwort, ob der http Statuscode 200 ist und die Antwort im JSON-Format vorliegt.- Parameters:
webResponse
-- Returns:
- true wenn HHTP code 200 und Antwortinhalt application/json ist, sonst false.
-