def replace_user_in_file_path(file_name, user):
    """Replace user name in give file path

    Args:
        file_name (str): Path to file
        user (str): New user to replace with

    Returns:
        str: New file path
    """
    file_items = [x.strip()
                  for x in file_name.strip().split('/') if len(x.strip())]
    file_items[1] = user

    return "/" + '/'.join(file_items).strip()