I have some groovy code (Jenkins Pipeline) to loop over a coverage directory and find any files matching a certain pattern. For any files found, I want to determine what their parent directory is named as. These files are currently in sub dirs under a coverage directory.
def coverageReportFiles = findFiles(glob: 'coverage/**/coverage-summary.json')
for(file in coverageReportFiles ){
echo "${file.directory}" // currently prints out 'false'
}
Are there any utilities with Jenkins Pipeline steps or anything native in groovy I can use to determine this?