code: public FilePath createScriptFile(@Nonnull FilePath dir) throws IOException, InterruptedException {
          return dir.createTextTempFile("jenkins", getFileExtension(), getContents(), false);
      }
docs: Creates a script file in a temporary name in the specified directory.