<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def createRtiFromFileName(fileName):
 """ Determines the type of RepoTreeItem to use given a file name and creates it. Uses a DirectoryRti for directories and an UnknownFileRti if the file extension doesn't match one of the registered RTI extensions. """

    cls, rtiRegItem = detectRtiFromFileName(fileName)
    if cls is None:
        logger.warn("Unable to import plugin {}: {}"
                    .format(rtiRegItem.fullName, rtiRegItem.exception))
        rti = UnknownFileRti.createFromFileName(fileName)
        rti.setException(rtiRegItem.exception)
    else:
        rti = cls.createFromFileName(fileName)

    assert rti, "Sanity check failed (createRtiFromFileName). Please report this bug."
    return rti