我的代码只删除文件中解析为Jenkins名称的文件。我想在上次提交中删除基于作者(Jenkins)的文件。什么是最好的解决方案?在提交中删除基于作者姓名的文件
def changelogPath = "C:\\test"
def PackID = "test"
def delete(String changelogPath, String PackID) {
String folderPath = "$changelogPath"+ "\\" + "$PackID"
new File(folderPath).eachFile(FileType.FILES) { file ->
if (file.name.contains('Jenkins')) file.delete()
}
delete(changelogPath, PackID)
检查这个帖子 - https://stackoverflow.com/questions/23151837/get-file-owner-metadata-information-with-java – Rao