def build_file_dict(file_metadata, resources_ignored, resources_updated, path):
    """
    Add the metadata files to the correct file list.

    Parameters
    ----------
    file_metadata: list
        List of FTS file metadata.
    resources_ignored: list
        List of resource string paths that were ignored during upload
    resources_updated: list
        List of resource string paths that were updated during upload
    path: str
        The path in the metadata we want to look for in the resources lists

    Returns
    -------
    Dictionary of file lists.
    """
    files = {
        'created': [],
        'updated': [],
        'ignored': []
    }
    for metadata in file_metadata:
        if metadata[path] in resources_ignored:
            files['ignored'].append(metadata)
        elif metadata[path] in resources_updated:
            files['updated'].append(metadata)
        else:
            files['created'].append(metadata)
    return files