public void loadRules(String rulesDir) throws Exception {
        this.rulesList.clear();
        
        File dir = new File(rulesDir);
        
        if (!dir.exists() || !dir.isDirectory()) {
            throw new Exception("Cannot load rules from rules directory!");
        }
        
        File[] rules = dir.listFiles(new FilenameFilter() {
            @Override
            public boolean accept(File directory, String fileName) {
                return fileName.endsWith(".rule");
            }
        });
        
        for (File f : rules) {
            Rule rule = new Rule(f);
            rulesList.add(rule);
        }
    }