title: How to read subfolders in jenkins pipeline
body: <p>I'm trying to write a pipeline jenkins job that loop through the subfolder of a specific directory and launch something. The problem is to access the filesystem. For some reason it does not seems to read the file system at all, neither its own workspace.</p>
  
  <p>This is the snippet I'm using</p>
  
  <pre><code>node ('label') {
      workspacePath = '/opt/installersWS'
      ws(workspacePath){
          stage ("test"){
              ...some stuff...
              runtimeBuildDir = new File(workspacePath + "/components")
              echo runtimeBuildDir.getPath()
              if (runtimeBuildDir.exists()){
                  echo "search for subfolders"
              } else {
                  echo "main folder not existing"
              }
  
          }
      }
  }
  </code></pre>
  
  <p>The folder of course is existing on the server but the run always return with the second echo.</p>
  
  <p><strong>UPDATE:</strong>
  I discover that all the gradle/java instruction given in this way is not targeting the node but are running on the master. This was why I didn't found the directories. So I was completely misunderstanding how the pipeline is working.</p>
  
  <p>Said that.. any idea on how can I retrieve that? Is there a way to set an gradle property from the shell step for example?</p>
  
  <p>Thanks,
  Michele</p>