code: static void deleteOldBuildDataDirs(File tmpDir, Log logger) {
          if (!tmpDir.exists()) {
              // Before creation of the @tmp directory
              return;
          }
          File[] buildDataDirs = tmpDir.listFiles(buildDataDir -> {
              long ageInMilliseconds = new Date().getTime() - buildDataDir.lastModified();
              return ageInMilliseconds > TimeUnit.DAYS.toMillis(1);
          });
          if (buildDataDirs == null) {
              logger.error("Failed while attempting to delete old build data dirs. Could not list files in " + tmpDir);
              return;
          }
  
          for (File buildDataDir : buildDataDirs) {
              try {
                  FileUtils.deleteDirectory(buildDataDir);
                  logger.debug(buildDataDir.getAbsolutePath() + " deleted");
              } catch (IOException e) {
                  logger.error("Failed while attempting to delete old build data dir: " + buildDataDir.toString(), e);
              }
          }
      }
docs: Delete @tmp/artifactory-pipeline-cache/build-number directories older than 1 day.