title: How to Approve Jenkins Scripted Pipeline RejectedAccessException for groovy.io.FileType FILES?
body: <p>I have a scripted Jenkins Pipeline and cannot approve the sandbox restriction for <code>groovy.io.FileType FILES</code>. For example the following Jenkins Pipeline snippet does not work in the sandbox out of the box:</p>
  
  <pre><code>new File("/tmp").eachFileRecurse(FileType.FILES) { file -&gt;
      echo "$file"
  }
  </code></pre>
  
  <p>An exception is thrown:</p>
  
  <pre><code>Exception stacktrace: org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticField groovy.io.FileType FILES
  at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectStaticField(StaticWhitelist.java:199)
  at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor$14.reject(SandboxInterceptor.java:372)
  at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:381)
  at org.kohsuke.groovy.sandbox.impl.Checker$6.call(Checker.java:288)
  at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:292)
  at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29)
  at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
  at WorkflowScript.copySqlFiles(WorkflowScript:101)
  at WorkflowScript.run(WorkflowScript:58)
  at org.jenkinsci.plugins.docker.workflow.Docker$Image.inside(jar:file:/var/jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:136)
  ...
  </code></pre>
  
  <p>Normally an entry is created for this type in 
  <code>Manage Jenkins » In-process Script Approval</code>, but for this exception not. This is really strange, because if I traverse directories with <code>new File("/tmp").eachFileRecurse(FileType.DIRECTORIES)</code> it is working and I could approve the exception, but now there is no approval entry generated for <code>FILES</code>...</p>