def get_pack_resource_file_abs_path(pack_ref, resource_type, file_path):
    """
    Retrieve full absolute path to the pack resource file.

    Note: This function also takes care of sanitizing ``file_name`` argument
          preventing directory traversal and similar attacks.

    :param pack_ref: Pack reference (needs to be the same as directory on disk).
    :type pack_ref: ``str``

    :param resource_type: Pack resource type (e.g. action, sensor, etc.).
    :type resource_type: ``str``

    :pack file_path: Resource file path relative to the pack directory (e.g. my_file.py or
                     directory/my_file.py)
    :type file_path: ``str``

    :rtype: ``str``
    """
    path_components = []
    if resource_type == "action":
        path_components.append("actions/")
    elif resource_type == "sensor":
        path_components.append("sensors/")
    elif resource_type == "rule":
        path_components.append("rules/")
    else:
        raise ValueError("Invalid resource type: %s" % (resource_type))

    path_components.append(file_path)
    file_path = os.path.join(*path_components)  # pylint: disable=E1120
    result = get_pack_file_abs_path(
        pack_ref=pack_ref, file_path=file_path, resource_type=resource_type
    )
    return result

    Retrieve full absolute path to the pack resource file.

    Note: This function also takes care of sanitizing ``file_name`` argument
          preventing directory traversal and similar attacks.

    :param pack_ref: Pack reference (needs to be the same as directory on disk).
    :type pack_ref: ``str``

    :param resource_type: Pack resource type (e.g. action, sensor, etc.).
    :type resource_type: ``str``

    :pack file_path: Resource file path relative to the pack directory (e.g. my_file.py or
                     directory/my_file.py)
    :type file_path: ``str``

    :rtype: ``str``
    
st2common/st2common/content/utils.py