git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4075 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
borg-0300 18 years ago
parent daf0f74361
commit d69013f66a

@ -6,6 +6,10 @@
// Frankfurt, Germany, 2005
// last major change: 11.07.2005
//
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
@ -71,34 +75,32 @@ public class defaultURLPattern extends abstractURLPattern implements plasmaURLPa
// first try to match the domain with wildcard '*'
// [TL] While "." are found within the string
int index = 0;
while ((index = hostlow.indexOf('.', index + 1)) != -1) {
while (!matched && (index = hostlow.indexOf('.', index + 1)) != -1) {
if ((app = (ArrayList) blacklistMap.get(hostlow.substring(0, index + 1) + "*")) != null) {
for (int i=app.size()-1; !matched && i>-1; i--) {
pp = (String)app.get(i);
matched |= ((pp.equals("*")) || (path.matches(pp)));
}
return matched;
}
}
index = hostlow.length();
while ((index = hostlow.lastIndexOf('.', index - 1)) != -1) {
while (!matched && (index = hostlow.lastIndexOf('.', index - 1)) != -1) {
if ((app = (ArrayList) blacklistMap.get("*" + hostlow.substring(index, hostlow.length()))) != null) {
for (int i=app.size()-1; !matched && i>-1; i--) {
pp = (String)app.get(i);
matched |= ((pp.equals("*")) || (path.matches(pp)));
}
return matched;
}
}
// try to match without wildcard in domain
if ((app = (ArrayList)blacklistMap.get(hostlow)) != null) {
if (!matched && (app = (ArrayList)blacklistMap.get(hostlow)) != null) {
for (int i=app.size()-1; !matched && i>-1; i--) {
pp = (String)app.get(i);
matched |= ((pp.equals("*")) || (path.matches(pp)));
}
return matched;
}
return false;
return matched;
}
}

Loading…
Cancel
Save