private static String getExtension(Metadata metadata) {
        if (metadata == null) {
            return StringUtils.EMPTY;
        }
        String name = metadata.get(TikaCoreProperties.RESOURCE_NAME_KEY);
        return FilenameUtils.getSuffixFromPath(name);
    }
Creates a TikaInputStream from the given database BLOB. The BLOB
length (if available) is stored as input metadata in the given
metadata instance.
<p>
Note that the result set containing the BLOB may need to be kept open
until the returned TikaInputStream has been processed and closed.
You must also always explicitly close the returned stream as in
some cases it may end up writing the blob data to a temporary file.

@param blob     database BLOB
@param metadata metadata instance
@return a TikaInputStream instance
@throws SQLException if BLOB data can not be accessed
tika-core/src/main/java/org/apache/tika/io/TikaInputStream.java