public static boolean checkHasMagika(String magikaCommandPath) {
        String[] commandline = new String[]{magikaCommandPath, "--version"};
        FileProcessResult result = null;
        try {
            result = ProcessUtils.execute(new ProcessBuilder(commandline),
                    1000, 1000, 1000);
        } catch (IOException e) {
            LOGGER.debug("problem with magika");
            return false;
        }

        if (result.getExitValue() != 0) {
            return false;
        }
        /* python
        Matcher m = Pattern
                .compile("Magika version:\\s+(.{4,50})").matcher("");

        */
        //rust
        Matcher m = Pattern
                .compile("magika ([^\\s]{4,50})").matcher("");
        for (String line : result.getStdout().split("[\r\n]+")) {
            if (m.reset(line).find()) {
                MAGIKA_VERSION_STRING = m.group(1);
                break;
            }
        }
        return true;
    }
Simple wrapper around Google's magika: https://github.com/google/magika
The tool must be installed on the host where Tika is running.
The default behavior is to run detection, report the results in the
metadata and then return null so that other detectors will be used.
tika-detectors/tika-detector-magika/src/main/java/org/apache/tika/detect/magika/MagikaDetector.java