Files.probeContentType() is an instance of FileTypeDetector class's abstract method String FileTypeDetector.probeContentType(), it's an extension based detector. So extend it in a new class or even anonyinter class (cannot do that because FileTypeDetector is an abstract class) might work.
public class MyDetector extends java.nio.file.spi.FileTypeDetector{
public String probeContentType(Path path) throws IOException{
return SOMESTRING;
}
}
//Call the detector
String type = MyDetector.probeContentType(path);