org.w3c.mwi.mobileok.basic
Class HTTPTextResource

java.lang.Object
  extended by org.w3c.mwi.mobileok.basic.HTTPResource
      extended by org.w3c.mwi.mobileok.basic.HTTPTextResource
Direct Known Subclasses:
HTTPCSSResource, HTTPXHTMLResource

public class HTTPTextResource
extends HTTPResource

Base class that represents an UTF-8 encoded text resource retrieved via HTTP (or HTTPS).

The class extends HTTPResource to add UTF-8 decoding functionality. The isValidUTF8() method returns true when the resource is correctly encoded in UTF-8, false otherwise. The getUTF8ErrorMessageList() method can be used to retrieve the list of UTF-8 validation errors.

Attempts are made to decode HTTP responses bodies that are not encoded in UTF-8. There is no guarantee that decoding may work, and the list of supported encodings actually depends on the system and/or on the version of the Java platform on which the code is run.

Version:
$Revision: 1.1 $
Author:
The W3C mobileOK Checker Task Force

Constructor Summary
HTTPTextResource(java.net.URI uri)
           
 
Method Summary
 java.lang.String getBody()
           
 java.util.List<ValidationByteMessage> getUTF8ErrorMessageList()
           
 boolean isValidUTF8()
           
 
Methods inherited from class org.w3c.mwi.mobileok.basic.HTTPResource
configureHTTPMethod, executeMethod, getLastRedirect, getRawRequestHeaders, getRawResponseBody, getRawResponseHeaders, getRedirect, getRedirectCount, getRequestHeaders, getResponseHeaders, getResponseProtocol, getResponseReason, getResponseStatus, getStatusCode, getURI, getURI, isValidDateHeader, isValidExpirationDate, massageURI, parseURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPTextResource

public HTTPTextResource(java.net.URI uri)
                 throws TestException
Throws:
TestException
Method Detail

getUTF8ErrorMessageList

public final java.util.List<ValidationByteMessage> getUTF8ErrorMessageList()

getBody

public final java.lang.String getBody()

isValidUTF8

public final boolean isValidUTF8()