public ClassPath getToolingImplementationClasspath(
     ProgressLoggerFactory progressLoggerFactory, File userHomeDir) {
   if (installedDistribution == null) {
     File installDir;
     try {
       File realUserHomeDir =
           userHomeDir != null
               ? userHomeDir
               : myUserHomeDir != null ? myUserHomeDir : GradleUserHomeLookup.gradleUserHome();
       Install install =
           new Install(
               new ProgressReportingDownload(progressLoggerFactory),
               new PathAssembler(realUserHomeDir));
       installDir = install.createDist(wrapperConfiguration);
     } catch (FileNotFoundException e) {
       throw new IllegalArgumentException(
           String.format("The specified %s does not exist.", getDisplayName()), e);
     } catch (Exception e) {
       throw new GradleConnectionException(
           String.format(
               "Could not install Gradle distribution from '%s'.",
               wrapperConfiguration.getDistribution()),
           e);
     }
     installedDistribution =
         new InstalledDistribution(installDir, getDisplayName(), getDisplayName());
   }
   return installedDistribution.getToolingImplementationClasspath(
       progressLoggerFactory, userHomeDir);
 }
 public String getDisplayName() {
   return String.format("Gradle distribution '%s'", wrapperConfiguration.getDistribution());
 }