private List<RuleSource> readRulesDirectory(File rulesDirectory) throws MojoExecutionException {
        if (rulesDirectory.exists() && !rulesDirectory.isDirectory()) {
            throw new MojoExecutionException(rulesDirectory.getAbsolutePath() + " does not exist or is not a directory.");
        }
        getLog().info("Reading rules from directory " + rulesDirectory.getAbsolutePath());
        try {
            return FileRuleSource.getRuleSources(rulesDirectory);
        } catch (IOException e) {
            throw new MojoExecutionException("Cannot read rulesDirectory: " + rulesDirectory.getAbsolutePath(), e);
        }
    }
private List < RuleSource > readRulesDirectory ( File rulesDirectory ) throws MojoExecutionException { if ( rulesDirectory . exists ( ) && ! rulesDirectory . isDirectory ( ) ) { throw new MojoExecutionException ( rulesDirectory . getAbsolutePath ( ) + " does not exist or is not a directory." ) ; } getLog ( ) . info ( "Reading rules from directory " + rulesDirectory . getAbsolutePath ( ) ) ; try { return FileRuleSource . getRuleSources ( rulesDirectory ) ; } catch ( IOException e ) { throw new MojoExecutionException ( "Cannot read rulesDirectory: " + rulesDirectory . getAbsolutePath ( ) , e ) ; } }
Retrieves the list of available rules from the rules directory.

@param rulesDirectory The rules directory.
@return The {@link java.util.List} of available rules
{@link java.io.File}s.
@throws MojoExecutionException If the rules directory cannot be read.