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.ContentTypedetect(android.webkit.WebResourceRequest request)Detects ContentType for given URL and headersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
OrderedContentTypeDetector
Creates an instance of a `MultipleContentTypeDetector` with provided detectorsAt the moment only
HeadersContentTypeDetectorandUrlFileExtensionTypeDetectorexists- Parameters:
detectors- an array of instances ofContentTypeDetector
-
-
Method Details
-
detect
public org.adblockplus.libadblockplus.FilterEngine.ContentType detect(android.webkit.WebResourceRequest request)Description copied from interface:ContentTypeDetectorDetects ContentType for given URL and headers- Specified by:
detectin interfaceContentTypeDetector- Parameters:
request- WebResourceRequest that contains all required info HTTP headers of incoming request including url and headers- Returns:
- ContentType or `null` if not detected
-