// ----------------------------------------------------------------
// create a default JobSpec
// ----------------------------------------------------------------
JobSpec spec = JobBuilder.buildJobSpec(jobFile.getAbsolutePath());
Job job = spec.getJob();
NameValueJobInput jobInput = (NameValueJobInput) spec.getIn();
// ----------------------------------------------------------------
// open the file to read. traverse through the list of directories
// name given & override the default Job's runDirName value with the
// directory name. then submit the Job.
// ----------------------------------------------------------------
try {
BufferedReader in = new BufferedReader(new FileReader(inputFname));
if (!in.ready())
throw new IOException();
String line = null;
String jobId = null;
while ((line = in.readLine()) != null) {
// overwrite the runDirName
jobInput.setNameValuePair("runDirName", line);
jobId = submitJob(job, jobInput);
LOG.log(Level.INFO, "Job Submitted: id: [" + jobId + "]");
}