Created
March 15, 2019 18:19
-
-
Save marcosborges/a615ca64afba41e994ec5e50d340f656 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment