@Test public void testEmptyDetector() { assertNull(new OrderedContentTypeDetector().detect(mockRequest(URI_IMAGE, XML_HEADER))); }
@Override public FilterEngine.ContentType detect(final WebResourceRequest request) { FilterEngine.ContentType contentType; for (final ContentTypeDetector detector : detectors) { contentType = detector.detect(request); if (contentType != null) { return contentType; } } return null; }
OrderedContentTypeDetector implements ContentTypeDetector { @Override public FilterEngine.ContentType detect(final WebResourceRequest request) { FilterEngine.ContentType contentType; for (final ContentTypeDetector detector : detectors) { contentType = detector.detect(request); if (contentType != null) { return contentType; } } return null; } }
OrderedContentTypeDetector implements ContentTypeDetector { @Override public FilterEngine.ContentType detect(final WebResourceRequest request) { FilterEngine.ContentType contentType; for (final ContentTypeDetector detector : detectors) { contentType = detector.detect(request); if (contentType != null) { return contentType; } } return null; } OrderedContentTypeDetector(final ContentTypeDetector... detectors); }
OrderedContentTypeDetector implements ContentTypeDetector { @Override public FilterEngine.ContentType detect(final WebResourceRequest request) { FilterEngine.ContentType contentType; for (final ContentTypeDetector detector : detectors) { contentType = detector.detect(request); if (contentType != null) { return contentType; } } return null; } OrderedContentTypeDetector(final ContentTypeDetector... detectors); @Override FilterEngine.ContentType detect(final WebResourceRequest request); }
OrderedContentTypeDetector implements ContentTypeDetector { @Override public FilterEngine.ContentType detect(final WebResourceRequest request) { FilterEngine.ContentType contentType; for (final ContentTypeDetector detector : detectors) { contentType = detector.detect(request); if (contentType != null) { return contentType; } } return null; } OrderedContentTypeDetector(final ContentTypeDetector... detectors); @Override FilterEngine.ContentType detect(final WebResourceRequest request);  }