@Bean("GlobalTempFolder")
  public TempFolder provide(ScannerProperties scannerProps, SonarUserHome userHome) {
    var workingPathName = StringUtils.defaultIfBlank(scannerProps.property(CoreProperties.GLOBAL_WORKING_DIRECTORY), CoreProperties.GLOBAL_WORKING_DIRECTORY_DEFAULT_VALUE);
    var workingPath = Paths.get(workingPathName);

    if (!workingPath.isAbsolute()) {
      var home = userHome.getPath();
      workingPath = home.resolve(workingPath).normalize();
    }
    try {
      cleanTempFolders(workingPath);
    } catch (IOException e) {
      LOG.error(String.format("failed to clean global working directory: %s", workingPath), e);
    }
    var tempDir = createTempFolder(workingPath);
    return new DefaultTempFolder(tempDir.toFile(), true);

  }
@Test
  void createTempFolderProps(@TempDir Path workingDir) throws Exception {
    Files.delete(workingDir);

    var tempFolder = underTest.provide(
      new ScannerProperties(Map.of(CoreProperties.GLOBAL_WORKING_DIRECTORY, workingDir.toAbsolutePath().toString())), sonarUserHome);
    tempFolder.newDir();
    tempFolder.newFile();

    assertThat(workingDir).isDirectory();
    assertThat(workingDir.toFile().list()).hasSize(1);
    var rootTmpDir = workingDir.toFile().listFiles()[0];
    assertThat(rootTmpDir.list()).hasSize(2);
  }