class Headers {

    /**
     * Gets suffix (for example jpg) of the specified file.
     *
     * @param file the specified file
     * @return suffix
     */
    public static String getSuffix(final FileUpload file) {<FILL_FUNCTION_BODY>}

    /**
     * Gets suffix (for example jpg) with the specified content type.
     *
     * @param contentType the specified content type
     * @return suffix
     */
    public static String getSuffix(final String contentType) {
        String ret;
        final String[] exts = MimeTypes.findExtensionsByMimeTypes(contentType, false);
        if (null != exts && 0 < exts.length) {
            ret = exts[0];
        } else {
            ret = StringUtils.substringAfter(contentType, "/");
            ret = StringUtils.substringBefore(ret, ";");
        }

        return ret;
    }

    /**
     * Gets a value of a header specified by the given header name from the specified request.
     *
     * @param request    the specified request
     * @param name       the given header name
     * @param defaultVal the specified default value
     * @return header value, returns {@code defaultVal} if not found this header
     */
    public static String getHeader(final Request request, final String name, final String defaultVal) {
        String value = request.getHeader(name);
        if (StringUtils.isBlank(value)) {
            return defaultVal;
        }

        return Escapes.escapeHTML(value);
    }

    /**
     * Private constructor.
     */
    private Headers() {
    }
}

        final String fileName = file.getFilename();
        String ret = StringUtils.substringAfterLast(fileName, ".");
        if (StringUtils.isNotBlank(ret)) {
            return ret;
        }

        final String contentType = file.getContentType();
        return getSuffix(contentType);
    
<no_super_class>