小编bto*_*bto的帖子

Groovy / jenkins:重命名文件

我想在 jenkins 中使用 groovy 将 lastModified() json 重命名为文件名+“处理”。我没有成功地做:

JSON_BASE_PATH="/json_repo/"

def file = new File(JSON_BASE_PATH).listFiles()?.sort { it.lastModified() }?.find{it=~/.json$/}
file.renameTo( new File( file.getName() + ".processing") )
print "Filename is : " + file
Run Code Online (Sandbox Code Playgroud)

如何重命名?

groovy file jenkins

2
推荐指数
1
解决办法
5297
查看次数

标签 统计

file ×1

groovy ×1

jenkins ×1