Fix classpath relative-to-absolute conversion in DotenvReader by Mooninaut · Pull Request #27 · cdimascio/dotenv-java

Escape . to prevent removing the trailing character from a simple directory name with no leading / or ./

Anchor the regex to prevent stripping a trailing literal . from a directory name, which is unlikely but possible

Add tests for simple resource directory and resource directory with trailing .

Examples of bug:
.directory("envdir") would try to load resources/envdi/.env and fail
.directory("/trailingdot./envdir") would try to load resources/trailingdot/envdir/.env and fail

Workaround: Always prefix classpath-relative directories with ./