def is_file_of_extension(entry, *args):
    """
    Checks if the given directory entry is a file
    and ends in one of the given extensions.

    Extensions are passed in the args parameter and
    must be prefixed by a dot.
    """
    if not entry.is_file():
        return False
    if not args:
        return True
    for arg in args:
        if entry.name.endswith(arg):
            return True
    return False