mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-09-21 21:26:16 +00:00
[HER-1668] support '-' SURT directives in seed files analogous to '+' (if a REJECTing SurtPrefixedDecideRule is present)
* SurtPrefixedDecideRule.java
pass only portion after directive ('+' or '-') to SurtPrefixSet
* SurtPrefixSet.java
better comment/param name
This commit is contained in:
@@ -132,14 +132,14 @@ public class SurtPrefixSet extends PrefixSet {
|
||||
|
||||
|
||||
/**
|
||||
* Interpret the given line as a directive, returning true if it
|
||||
* was meaningful.
|
||||
* Interpret the given SURT/URI/host as a directive, returning true
|
||||
* if it was meaningful.
|
||||
*
|
||||
* @param line potential directive
|
||||
* @param suri potential directive
|
||||
* @return boolean true if applied as directive, false otherwise
|
||||
*/
|
||||
public boolean considerAsAddDirective(String line) {
|
||||
String u = line.trim();
|
||||
public boolean considerAsAddDirective(String suri) {
|
||||
String u = suri.trim();
|
||||
if(u.length()==0) {
|
||||
// empty string: consider a mistake
|
||||
return false;
|
||||
|
||||
+1
-1
@@ -274,7 +274,7 @@ implements
|
||||
public boolean nonseedLine(String line) {
|
||||
String effectiveDirective = getEffectiveAddDirective();
|
||||
if(line.startsWith(effectiveDirective)) {
|
||||
return surtPrefixes.considerAsAddDirective(line);
|
||||
return surtPrefixes.considerAsAddDirective(line.substring(effectiveDirective.length()));
|
||||
} else {
|
||||
// not a line this instance is interested in
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user