Closed yrezgui closed 2 years ago
Can you add a stack trace or something for how this fails? I added tests (to my WIP branch) for Files.probeContentType
and it worked without me adding any code, which made me suspicious.
Ah, I see now. It's impossible to load a custom implementation of FileTypeDetector
because our detector would be in the app's APK but the system only looks in the system's classpath for the service loader data.
If the file extension matches the correct mime type it works. If it doesn't, then this method will either return the wrong values or null, unfortunately.
The method
Files.probeContentType
doesn't seem to work withContentPath
. See documentation here