public List<String> getRuleFileNames() {
    List<String> ruleFiles = new ArrayList<>();
    ResourceDataBroker dataBroker = JLanguageTool.getDataBroker();
    ruleFiles.add(dataBroker.getRulesDir()
            + "/" + getShortCode() + "/" + JLanguageTool.PATTERN_FILE);
    if (getShortCodeWithCountryAndVariant().length() > 2) {
      String fileName = getShortCode() + "/"
              + getShortCodeWithCountryAndVariant()
              + "/" + JLanguageTool.PATTERN_FILE;
      if (dataBroker.ruleFileExists(fileName)) {
        ruleFiles.add(dataBroker.getRulesDir() + "/" + fileName);
      }
    }
    return ruleFiles;
  }
public List < String > getRuleFileNames ( ) { List < String > ruleFiles = new ArrayList < > ( ) ; ResourceDataBroker dataBroker = JLanguageTool . getDataBroker ( ) ; ruleFiles . add ( dataBroker . getRulesDir ( ) + "/" + getShortCode ( ) + "/" + JLanguageTool . PATTERN_FILE ) ; if ( getShortCodeWithCountryAndVariant ( ) . length ( ) > 2 ) { String fileName = getShortCode ( ) + "/" + getShortCodeWithCountryAndVariant ( ) + "/" + JLanguageTool . PATTERN_FILE ; if ( dataBroker . ruleFileExists ( fileName ) ) { ruleFiles . add ( dataBroker . getRulesDir ( ) + "/" + fileName ) ; } } return ruleFiles ; }
Get the location of the rule file(s) in a form like {@code /org/languagetool/rules/de/grammar.xml},
i.e. a path in the classpath. The files must exist or an exception will be thrown, unless the filename
contains the string {@code -test-}.