greenmail-mail-test / greenmail

Official master for the Greenmail project
http://greenmail-mail-test.github.io/greenmail/
Apache License 2.0
640 stars 184 forks source link

loadEmails not working for directories on Windows primary partition #805

Closed gitUserII closed 1 month ago

gitUserII commented 1 month ago

By fixing Issue #682 the loadEmails function in GreenMail.java got broken on Windows machines, because C:\ is always hidden. image

Even if C:\ wasn't hidden no directory in Paths.get(System.getProperty("java.io.tmpdir") can be used as these directories are created in C:\Users\user\AppData\Local\Temp and AppData is also hidden.

Suggestion: only check for hidden parents that are subdirectories of the used sourceDirectory, or use a flag to skip the hidden directory check.

This holds true for OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7) on windows 10 and 11.

marcelmay commented 1 month ago

@gitUserII , thanks for raising this. Check will only check below sourceDirectory.