public Path validateFile(String name) {
        URL url = validateUrl(name);
        File file;

        try {
            file = new File(url.toURI().getRawPath()).getAbsoluteFile();
        } catch (URISyntaxException e) {
            throw new ConfigException(name, url.toString(), String.format("The OAuth configuration option %s contains a URL (%s) that is malformed: %s", name, url, e.getMessage()));
        }

        if (!file.exists())
            throw new ConfigException(name, file, String.format("The OAuth configuration option %s contains a file (%s) that doesn't exist", name, file));

        if (!file.canRead())
            throw new ConfigException(name, file, String.format("The OAuth configuration option %s contains a file (%s) that doesn't have read permission", name, file));

        if (file.isDirectory())
            throw new ConfigException(name, file, String.format("The OAuth configuration option %s references a directory (%s), not a file", name, file));

        return file.toPath();
    }
Validates that, if a value is supplied, is a file that:

<li>
    <ul>exists</ul>
    <ul>has read permission</ul>
    <ul>points to a file</ul>
</li>

If the value is null or an empty string, it is assumed to be an "empty" value and thus.
ignored. Any whitespace is trimmed off of the beginning and end.
clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/secured/ConfigurationUtils.java