Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def file_exists(filename){
- try{
- return java.nio.file.Files.exists(java.nio.file.Paths.get(filename.toString()))
- } catch(e) {
- return false
- }
- }
- def arquivo = "/path/do/meu/arquivo"
- if(file_exists("${arquivo}")){
- echo "Arquivo existe"
- } else {
- echo "Arquivo não existe"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement