com.google.caja.service
Class StrictContentTypeCheck

java.lang.Object
  extended by com.google.caja.service.ContentTypeCheck
      extended by com.google.caja.service.StrictContentTypeCheck

public class StrictContentTypeCheck
extends ContentTypeCheck

Strict content-type check checks if the requested content-type is exactly the same as the received content-type

Author:
jasvir@google.com (Jasvir Nagra)

Constructor Summary
StrictContentTypeCheck()
           
 
Method Summary
 boolean check(java.lang.String spec, java.lang.String candidate)
          Checks if the spec matches candidate exactly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrictContentTypeCheck

public StrictContentTypeCheck()
Method Detail

check

public boolean check(java.lang.String spec,
                     java.lang.String candidate)
Checks if the spec matches candidate exactly

Specified by:
check in class ContentTypeCheck
Parameters:
spec - a specification by the recipient of a stream of data describing the set of mime-types that the recipient can accept. This mime-type may contain wildcards.
candidate - the concrete mime-type of a stream of data. This mime-type must never contain wildcards.
Returns:
true if the primary and subtype of spec matches candidate, else returns false


Copyright (C) 2008 Google Inc.
Licensed under the Apache License, Version 2.0