source: SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/scan/EndpointUrlFilterDeny.java @ 6153

Last change on this file since 6153 was 6153, checked in by emanuel.dima@uni-tuebingen.de, 9 years ago
  1. beta-39: updated java comments, better build script
File size: 698 bytes
Line 
1package eu.clarin.sru.fcs.aggregator.scan;
2
3import java.util.Collections;
4import java.util.HashSet;
5import java.util.Set;
6
7/**
8 * Allow takes precedence over deny; default is to include everything.
9 * Filters for the cache of scan data (endpoint/resources descriptions)
10 * based on endpoint url.
11 *
12 * @author yanapanchenko
13 */
14public class EndpointUrlFilterDeny implements EndpointFilter {
15
16        private Set<String> deny = new HashSet<String>();
17
18        public EndpointUrlFilterDeny(String... fragments) {
19                Collections.addAll(deny, fragments);
20        }
21
22        @Override
23        public boolean filter(String endpoint) {
24                for (String d : deny) {
25                        if (endpoint.contains(d)) {
26                                return false;
27                        }
28                }
29                return true;
30        }
31
32}
Note: See TracBrowser for help on using the repository browser.