public File createJobSubmissionJAR( final ClientRuntimeProtocol.JobSubmissionProto jobSubmissionProto, final Configuration driverConfiguration) throws IOException { // Copy all files to a local job submission folder final File jobSubmissionFolder = makejobSubmissionFolder(); LOG.log(Level.FINE, "Staging submission in {0}", jobSubmissionFolder); final File localFolder = new File(jobSubmissionFolder, this.fileNames.getLocalFolderName()); final File globalFolder = new File(jobSubmissionFolder, this.fileNames.getGlobalFolderName()); this.copy(jobSubmissionProto.getGlobalFileList(), globalFolder); this.copy(jobSubmissionProto.getLocalFileList(), localFolder); // Store the Driver Configuration in the JAR file. this.configurationSerializer.toFile( driverConfiguration, new File(localFolder, this.fileNames.getDriverConfigurationName())); // Create a JAR File for the submission final File jarFile = File.createTempFile(this.fileNames.getJobFolderPrefix(), this.fileNames.getJarFileSuffix()); LOG.log(Level.FINE, "Creating job submission jar file: {0}", jarFile); new JARFileMaker(jarFile).addChildren(jobSubmissionFolder).close(); if (this.deleteTempFilesOnExit) { LOG.log(Level.FINE, "Deleting the temporary job folder [{0}] and marking the jar file [{1}] for deletion after the JVM exits.", new Object[]{jobSubmissionFolder.getAbsolutePath(), jarFile.getAbsolutePath()}); jobSubmissionFolder.delete(); jarFile.deleteOnExit(); } else { LOG.log(Level.FINE, "Keeping the temporary job folder [{0}] and jar file [{1}] available after job submission.", new Object[]{jobSubmissionFolder.getAbsolutePath(), jarFile.getAbsolutePath()}); } return jarFile; }