private boolean accepts(String acceptHeader, String toAccept) {
        String[] acceptValues = acceptHeader.split("\\s*(,|;)\\s*");
        Arrays.sort(acceptValues);
        return Arrays.binarySearch(acceptValues, toAccept) > -1
                || Arrays.binarySearch(acceptValues, toAccept.replaceAll("/.*$", "/*")) > -1
                || Arrays.binarySearch(acceptValues, "*/*") > -1;
    }
Returns true if the given accept header accepts the given value.

@param acceptHeader The accept header.
@param toAccept     The value to be accepted.
@return True if the given accept header accepts the given value.
src/main/java/com/kodedu/controller/FileService.java