import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
private boolean isAllowed(MetaData meta, List<String> whitelist,
List<String> blacklist) {
- if (!whitelist.isEmpty() && !whitelist.contains(meta.getSource())) {
- return false;
+ MetaResultList one = new MetaResultList(Arrays.asList(meta));
+ if (!whitelist.isEmpty()) {
+ if (one.filter(whitelist, null, null).isEmpty()) {
+ return false;
+ }
}
-
- if (blacklist.contains(meta.getSource())) {
- return false;
+ if (!blacklist.isEmpty()) {
+ if (!one.filter(blacklist, null, null).isEmpty()) {
+ return false;
+ }
}
return true;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
}
private boolean isAllowed(MetaData meta, WLoginResult login) {
- if (login.isWl() && !whitelist.isEmpty()
- && !whitelist.contains(meta.getSource())) {
- return false;
+ MetaResultList one = new MetaResultList(Arrays.asList(meta));
+ if (login.isWl() && !whitelist.isEmpty()) {
+ if (one.filter(whitelist, null, null).isEmpty()) {
+ return false;
+ }
}
- if (login.isBl() && blacklist.contains(meta.getSource())) {
- return false;
+ if (login.isBl() && !blacklist.isEmpty()) {
+ if (!one.filter(blacklist, null, null).isEmpty()) {
+ return false;
+ }
}
return true;