code: public static InputStream getStream(String path) throws IOException {
      // the other ways to load the stream like
      // "Tools.class.getClass().getResourceAsStream(filename)"
      // don't work in a web context (using Grails):
      InputStream is = Tools.class.getResourceAsStream(path);
      if (is == null) {
        throw new IOException("Could not load file from classpath: '" + path + "'");
      }
      return is;
    }
docs: Load a file from the classpath using {@link Class#getResourceAsStream(String)}.
  Please load files in the {@code rules} and {@code resource} directories with
  {@link org.languagetool.databroker.ResourceDataBroker} instead.