public void inform(ResourceLoader loader) throws IOException {String dicts[] = dictionaryFiles.split(",");InputStream affix = null;List<InputStream> dictionaries = new ArrayList<>();try {dictionaries = new ArrayList<>();for (String file : dicts) {dictionaries.add(loader.openResource(file));}affix = loader.openResource(affixFile);Path tempPath = Files.createTempDirectory(Dictionary.getDefaultTempDir(), "Hunspell");try (Directory tempDir = FSDirectory.open(tempPath)) {this.dictionary = new Dictionary(tempDir, "hunspell", affix, dictionaries, ignoreCase);} finally {IOUtils.rm(tempPath);}} catch (ParseException e) {throw new IOException("Unable to load hunspell data! [dictionary=" + dictionaries + ",affix=" + affixFile + "]", e);} finally {IOUtils.closeWhileHandlingException(affix);IOUtils.closeWhileHandlingException(dictionaries);}}
public virtual void Inform(IResourceLoader loader){string[] dicts = dictionaryFiles.Split(',').TrimEnd();Stream affix = null;IList<Stream> dictionaries = new List<Stream>();try{dictionaries = new List<Stream>();foreach (string file in dicts){dictionaries.Add(loader.OpenResource(file));}affix = loader.OpenResource(affixFile);this.dictionary = new Dictionary(affix, dictionaries, ignoreCase);}catch (Exception e){throw new IOException("Unable to load hunspell data! [dictionary=" + dictionaries + ",affix=" + affixFile + "]", e);}finally{IOUtils.DisposeWhileHandlingException(affix);IOUtils.DisposeWhileHandlingException(dictionaries);}}