private String getExtension(Path fullPath) {
        String p = fullPath
                .getFileName()
                .toString();
        int i = p.lastIndexOf(".");
        if (i > -1) {
            return p
                    .substring(i + 1)
                    .toLowerCase(Locale.ROOT);
        }
        return "";
    }
Simple extension extractor that takes whatever comes after the
last period in the path.  It returns a lowercased version of the "extension."
<p>
If there is no period, it returns an empty string.

@param fullPath full path from which to try to find an extension
@return the lowercased extension or an empty string
tika-batch/src/main/java/org/apache/tika/batch/fs/FSFileResource.java