org.w3c.mwi.mobileok.basic
Class HTTPObjectResource

java.lang.Object
  extended by org.w3c.mwi.mobileok.basic.HTTPResource
      extended by org.w3c.mwi.mobileok.basic.HTTPObjectResource

public class HTTPObjectResource
extends HTTPResource

Represents an object resource retrieved via HTTP (or HTTPS).

The class extends HTTPResource to add image format validation, image type validation against the declared content-type and extraction of image properties (width, height, image type).

The class is not intended to be generic. An object element in mobileOK should only be used to link to an image, whereas it could be used in theory to link to all sorts of resources.

The class is very similar to the HTTPImageResource class. It could extend the HTTPImageResource in the future.

Author:
The W3C mobileOK Checker Task Force

Constructor Summary
HTTPObjectResource(java.net.URI uri, java.lang.String markupContentType)
           
 
Method Summary
 java.lang.String getContentType()
           
 java.util.List<ValidationByteMessage> getImageErrorMessageList()
           
 int getImageHeight()
           
 java.lang.String getImageType()
           
 int getImageWidth()
           
 LoadType getLoadType()
           
 boolean hasTransparency()
           
 boolean isValid()
           
(package private)  void setImageErrorMessageList(java.util.List<ValidationByteMessage> imageErrorMessageList)
           
(package private)  void setImageHeight(int imageHeight)
           
(package private)  void setImageType(java.lang.String contentType)
           
(package private)  void setImageWidth(int imageWidth)
           
 void setLoadType(LoadType loadType)
           
(package private)  void setTransparency(boolean transparency)
           
(package private)  void setValid(boolean valid)
           
 
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

HTTPObjectResource

public HTTPObjectResource(java.net.URI uri,
                          java.lang.String markupContentType)
                   throws TestException
Throws:
TestException
Method Detail

getContentType

public final java.lang.String getContentType()

getLoadType

public final LoadType getLoadType()

setLoadType

public void setLoadType(LoadType loadType)

setImageErrorMessageList

final void setImageErrorMessageList(java.util.List<ValidationByteMessage> imageErrorMessageList)

getImageErrorMessageList

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

isValid

public final boolean isValid()

setValid

final void setValid(boolean valid)

getImageType

public final java.lang.String getImageType()

setImageType

final void setImageType(java.lang.String contentType)

getImageHeight

public final int getImageHeight()

setImageHeight

final void setImageHeight(int imageHeight)

getImageWidth

public final int getImageWidth()

setImageWidth

final void setImageWidth(int imageWidth)

hasTransparency

public final boolean hasTransparency()

setTransparency

final void setTransparency(boolean transparency)