def getFilePathsWithExtensionsInDirectory(dirTree, patterns, sort=True):
    filePaths = []
    for root, dirs, files in os.walk(dirTree):
        for filePath in files:
            for pattern in patterns:
                if fnmatch.fnmatch(filePath, pattern):
                    fullPath = os.path.join(root, filePath)
                    filePaths.append(fullPath)
                    break
    if sort:
        filePaths.sort()
    return filePaths