mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-11-14 18:00:49 +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:
1 parent
ee1c9e2ce4
commit
142c72fc04
2 files changed
+6
-6
No files matched your search
@@ -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