class FileRuleWatcher extends FileSystemWatcher<Collection<FilterRule>> {

    @Override
    protected Collection<FilterRule> loadContents(InputStream in) throws IOException {
        
        try {
            List<RuleConfig> mergedRuleConfigs = loadRuleConfigs(in);
            List<FilterRule> filterRules = new ArrayList<>();
            /**
             * This has been changed to support extended options.
             */
            for (RuleConfig ruleConfig : mergedRuleConfigs) {
                
                try {
                    FilterRule filter = (FilterRule) Class.forName(ruleConfig.filterClassName).newInstance();
                    
                    FilterOptions option = new FilterOptions();
                    
                    if (ruleConfig.ttlValue != null) {
                        option.setTTL(Long.parseLong(ruleConfig.ttlValue));
                    }
                    if (ruleConfig.ttlUnits != null) {
                        option.setTTLUnits(ruleConfig.ttlUnits);
                    }
                    option.setOption(AgeOffConfigParams.MATCHPATTERN, ruleConfig.matchPattern);
                    
                    StringBuilder extOptions = new StringBuilder();
                    
                    for (Entry<String,String> myOption : ruleConfig.extendedOptions.entrySet()) {
                        option.setOption(myOption.getKey(), myOption.getValue());
                        extOptions.append(myOption.getKey()).append(",");
                    }
                    
                    int extOptionLen = extOptions.length();
                    
                    option.setOption(AgeOffConfigParams.EXTENDED_OPTIONS, extOptions.toString().substring(0, extOptionLen - 1));
                    
                    filter.init(option, iterEnv);
                    
                    filterRules.add(filter);
                    
                } catch (InstantiationException | ClassNotFoundException | IllegalAccessException e) {
                    log.error(e);
                    throw new IOException(e);
                }
            }
            return filterRules;
        } catch (Exception ex) {
            log.error("uh oh: " + ex);
            throw new IOException(ex);
        } finally {
            IOUtils.closeStream(in);
        }
        
    }

    public  FileRuleWatcher(FileSystem fs, Path filePath, long configuredDiff);
    public  FileRuleWatcher(FileSystem fs, Path filePath, long configuredDiff, IteratorEnvironment iterEnv);
    public  FileRuleWatcher(Path filePath, long configuredDiff);
    public  FileRuleWatcher(Path filePath, long configuredDiff, IteratorEnvironment iterEnv);

}