SHARE
TWEET

Untitled

a guest Mar 20th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def file_exists(filename){
  2.     try{
  3.         return java.nio.file.Files.exists(java.nio.file.Paths.get(filename.toString()))
  4.     } catch(e) {
  5.         return false
  6.     }
  7. }
  8.  
  9. def arquivo = "/path/do/meu/arquivo"
  10.  
  11. if(file_exists("${arquivo}")){
  12.    echo "Arquivo existe"
  13. } else {
  14.    echo "Arquivo não existe"
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top