All pastes #99673 Raw Edit

config.java

public text v1 · immutable
#99673 ·published 2006-07-25 14:49 UTC
rendered paste body
    public static final String  SAY_FILTER_FILE= "./config/sayfilter.txt";

...

                USE_SAY_FILTER                  = Boolean.parseBoolean(optionsSettings.getProperty("UseSayFilter", "false"));
                if(USE_SAY_FILTER){
                    try{
                    LineNumberReader lnr = null;
                    File say_filter = new File(SAY_FILTER_FILE);
                    lnr = new LineNumberReader(new BufferedReader(new FileReader(say_filter)));
                    String line = null;
                    while ((line = lnr.readLine()) != null){
                        if (line.trim().length() == 0 || line.startsWith("#"))
                        {
                            continue;
                        }
                        FILTER_LIST.add(line);
                    }
                    }catch (FileNotFoundException e)
                    {
                        _log.warning("sayfilter.txt is missing in config folder");
                    }
                    catch (Exception e)
                    {
                        _log.warning("error loading say filter: " + e);
                    }
                    _log.config("Say Filter: Loaded " + FILTER_LIST.size() + " words");
                }