Class HeadersContentTypeDetector

java.lang.Object
org.adblockplus.libadblockplus.android.webview.content_type.HeadersContentTypeDetector
All Implemented Interfaces:
ContentTypeDetector

public class HeadersContentTypeDetector
extends java.lang.Object
implements ContentTypeDetector
Detects content type based on headers

It has a limited functionality and can detect only two types of content: - FilterEngine.ContentType.XMLHTTPREQUEST and - FilterEngine.ContentType.SUBDOCUMENT

Should be used in OrderedContentTypeDetector

  • Constructor Summary

    Constructors
    Constructor Description
    HeadersContentTypeDetector()  
  • Method Summary

    Modifier and Type Method Description
    org.adblockplus.libadblockplus.FilterEngine.ContentType detect​(android.webkit.WebResourceRequest request)
    Detects ContentType for given URL and headers

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HeadersContentTypeDetector

      public HeadersContentTypeDetector()
  • Method Details

    • detect

      public org.adblockplus.libadblockplus.FilterEngine.ContentType detect​(android.webkit.WebResourceRequest request)
      Description copied from interface: ContentTypeDetector
      Detects ContentType for given URL and headers
      Specified by:
      detect in interface ContentTypeDetector
      Parameters:
      request - WebResourceRequest that contains all required info HTTP headers of incoming request including url and headers
      Returns:
      ContentType or `null` if not detected