Package org.kiwiproject.beta.net
Class KiwiHttpResponses2
java.lang.Object
org.kiwiproject.beta.net.KiwiHttpResponses2
Utilities related to HTTP responses.
Some of these methods may eventually be moved into org.kiwiproject.net.KiwiHttpResponses
in kiwi.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringhtmlEscape(String entity, String mediaType) If themediaTypeis HTML (text/html), return the escaped entity.
-
Method Details
-
htmlEscape
If themediaTypeis HTML (text/html), return the escaped entity. Otherwise, returnentitywithout modification.- Parameters:
entity- the response entitymediaType- the media type to evaluate- Returns:
- the HTML-escaped entity if the response is HTML, otherwise the original entity
- Throws:
IllegalArgumentException- ifentityis null ormediaTypeis blank- See Also:
-
HtmlEscapers
-