If you'd like to determine another resource directory location this default data broker provides proper methods. Assuming your {@code /rules} and {@code /resource} directories are accessiblevia class-path with following path information:
Make sure that you never obtain any grammar checker resources by calling {@code Object.class.getResource(String)} or {@code Object.class.getResourceAsStream(String)} directly. If you would like toobtain something from these directories do always use {@link JLanguageTool#getDataBroker()} which provides proper methods forreading the directories above.
For example, if you want to get the {@link URL} of {@code /rules/de/grammar.xml} just invoke{@link ResourceDataBroker#getFromRulesDirAsUrl(String)} and pass {@code /de/grammar.xml} as a string. Note: The {@code /rules} directory's name isn'tpassed, because its name might have changed. The same usage does apply for the {@code /resource} directory. @see ResourceDataBroker @author PAX @since 1.0.1
|
|
|
|