mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-10-03 10:57:43 +00:00
Merge pull request #13 from travisfw/master
have TooManyPathSegmentsDecideRule count path segments only
This commit is contained in:
+3
-3
@@ -63,11 +63,11 @@ public class TooManyPathSegmentsDecideRule extends PredicatedDecideRule {
|
||||
*/
|
||||
@Override
|
||||
protected boolean evaluate(CrawlURI curi) {
|
||||
String uri = curi.toString();
|
||||
String uriPath = curi.getUURI().getEscapedPath();
|
||||
int count = 0;
|
||||
int threshold = getMaxPathDepth();
|
||||
for (int i = 0; i < uri.length(); i++) {
|
||||
if (uri.charAt(i) == '/') {
|
||||
for (int i = 0; i < uriPath.length(); i++) {
|
||||
if (uriPath.charAt(i) == '/') {
|
||||
count++;
|
||||
}
|
||||
if (count > threshold) {
|
||||
|
||||
Reference in New Issue
Block a user