title: Jenkins Pipeline file exists if else
body: <p>everybody,
  I have a problem with a stage in a Declaritive pipeline in Jenkins. 
  I'd like Jenkins to check if the directory /root/elp contains data with the name *.php If this is the case, jenkins should execute a command. If there is nothing in the folder, Jenkins should finish the job with success.</p>
  
  <p>My Code that not function :</p>
  
  <pre><code>        stage('Test Stage') {
          steps {
              script {
                  def folder = new File( '/root/elp/test.php' )
                      if( folder.exists() ) {
                          sh "LINUX SHELL COMMAND"
                      } else {
                          println "File doesn't exist" 
                      }
          }
      }
  </code></pre>