Although I didn't succeeded with curl, I was able to at least find an alternative solution using Artifactory JFrog CLI library:
stdout = bat(returnStdout: true, script: "jfrog rt s --url https:/myartifactory.com/ --apikey "${ART_PSW}" --user ${ART_USR} --count myteam/myfile.exe")
def deployed_count = stdout.readLines().last().trim()
... this returns 0 or 1 depending on if file exists or not.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…