def dump_resource_to_files(resource, content_type=None, directory=None):
    """
    Convenience function. See
    :meth:`everest.resources.io.ConnectedResourcesSerializer.to_files` for
    details.

    If no directory is given, the current working directory is used.
    The given context type defaults to CSV.
    """
    if directory is None:
        directory = os.getcwd() # pragma: no cover
    if content_type is None:
        content_type = CsvMime
    srl = ConnectedResourcesSerializer(content_type)
    srl.to_files(resource, directory=directory)