public void importFromMixed ( Reader r , boolean deduceFromSeeds ) { BufferedReader reader = new BufferedReader ( r ) ; String s ; Iterator < String > iter = new RegexLineIterator ( new LineReadingIterator ( reader ) , RegexLineIterator . COMMENT_LINE , RegexLineIterator . NONWHITESPACE_ENTRY_TRAILING_COMMENT , RegexLineIterator . ENTRY ) ; while ( iter . hasNext ( ) ) { s = ( String ) iter . next ( ) ; if ( s . startsWith ( SURT_PREFIX_DIRECTIVE ) ) { considerAsAddDirective ( s . substring ( SURT_PREFIX_DIRECTIVE . length ( ) ) ) ; continue ; } else { if ( deduceFromSeeds ) { // also deducing 'implied' SURT prefixes // from normal URIs/hostname seeds addFromPlain ( s ) ; } } } }
Import SURT prefixes from a reader with mixed URI and SURT prefix format .