Use Jetty 9.4.20.v20190813 (there are updates to UTF-8 handling of resources on java.nio.file.FileSystem
present since 9.4.16.v20190411 that you need)
Since I don't know what eXist-db does to start Jetty, I'm going to assume it's embedded, and answer based on that assumption.
Make sure your ServletContextHandler
or WebAppContext
is declared to use a Base Resource that is defined as a PathResource
object pointing to your directory location defined as a java.nio.file.Path
object.
Advice about Base Resource declaration:
- Do not use a
String
to define it, that winds up being a URLResource
which works with URL references, not file system paths, and you'll have the problem you are experiencing.
- Do not use a
File
to define it, as that winds up being a FileResource
which is deprecated functionality, and known to have problems with UTF-8 references.
- Ensure your
java.nio.file.Path
is an absolute path. (no relative paths)
- Ensure your
java.nio.file.Path
is normalized. (no "//"
or "/../"
segments)