Back then Paul mentioned the `hasExtension` method, which correctly works with case-insensitive file systems [1]. Maybe there's something similar for stripping.

[1] https://github.com/scala/scala/commit/f543b45ac842