In a Vaadin 14 web app project created by the \"Plain Java Servlet\" flavor of the Vaadin Starter page, there are numerous folders automatically created by the Maven POM fil
You put them in src/main/resources
as it is the convention also outside of a Vaadin application.
Vaadin adds several other resource roots for things that later end up in places in the jar, that are conventient for vaadin to find (e.g. under META-INF/resources/...
).
resources
still ends up in the root of the jar or get properly "classpathed" by the build-tools and is safe to load non-classes via the classloader in your application.
You can open your text file from there by calling Class::getResourceAsStream, returning an InputStream. Note the leading slash character.
InputStream inputStream = this.getClass().getResourceAsStream( "/myfile.txt" ) ;