Class OrderedContentTypeDetector

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

public class OrderedContentTypeDetector
extends java.lang.Object
implements ContentTypeDetector
Detects content type based on HeadersContentTypeDetector and UrlFileExtensionTypeDetector

Can accept a list of content type detectors

FilterEngine.ContentType.XMLHTTPREQUEST is detected separately just by checking header `HEADER_REQUESTED_WITH_XMLHTTPREQUEST`

  • Constructor Summary

    Constructors
    Constructor Description
    OrderedContentTypeDetector​(ContentTypeDetector... detectors)
    Creates an instance of a `MultipleContentTypeDetector` with provided detectors
  • 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

  • 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