code: public Configuration writeConfiguration(final File jobFolder,
                                            final String jobId,
                                            final String clientRemoteId) throws IOException {
      final File driverFolder = new File(jobFolder, PreparedDriverFolderLauncher.DRIVER_FOLDER_NAME);
  
      final Configuration driverConfiguration1 = driverConfigurationProvider
          .getDriverConfiguration(jobFolder.toURI(), clientRemoteId,
          jobId, Constants.DRIVER_CONFIGURATION_WITH_HTTP_AND_NAMESERVER);
      final ConfigurationBuilder configurationBuilder = Tang.Factory.getTang().newConfigurationBuilder();
      for (final ConfigurationProvider configurationProvider : this.configurationProviders) {
        configurationBuilder.addConfiguration(configurationProvider.getConfiguration());
      }
      final Configuration providedConfigurations = configurationBuilder.build();
      final Configuration driverConfiguration = Configurations.merge(
          driverConfiguration1,
          Tang.Factory.getTang()
            .newConfigurationBuilder()
            .bindNamedParameter(JobSubmissionDirectory.class, driverFolder.toString())
            .build(),
          providedConfigurations);
      final File driverConfigurationFile = new File(driverFolder, fileNames.getDriverConfigurationPath());
      configurationSerializer.toFile(driverConfiguration, driverConfigurationFile);
      return driverConfiguration;
    }
docs: Writes driver configuration to disk.
  @param jobFolder The folder in which the job is staged.
  @param jobId id of the job to be submitted
  @param clientRemoteId The client remote id
  @return the configuration
  @throws IOException