import glob


def getFilesInDir(dirPath,fileExt):
    """
    List all the files with desired extension in a specific directory 
    """
    if not dirPath.is_dir():
        return {'ErrorCode':'404','ErrorMsg':'Directory {0} Not Found.'.format(dirPath)}

    filePattern = "{0}/{1}".format(str(dirPath),fileExt)
    filesList = glob.glob(filePattern)
    return filesList