def _remove_file(file_path):
    """Removes a file reference from the db."""
    # Check if the remove is for a single file object or for a folder
    if file_path.find(".vmdk") != -1:
        if file_path not in _db_content.get("files"):
            raise vexc.FileNotFoundException(file_path)
        _db_content.get("files").remove(file_path)
    else:
        # Removes the files in the folder and the folder too from the db
        to_delete = set()
        for file in _db_content.get("files"):
            if file.find(file_path) != -1:
                to_delete.add(file)
        for file in to_delete:
            _db_content.get("files").remove(file)
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/virt/vmwareapi/fake.py/_remove_file/original