elem.addContent(deleteWhenFreeElem);
*/
}
public RunScriptTask readTask(Element elem) throws IOException {
RunScriptTask task = new RunScriptTask(null, null);
List children = elem.getChildren();
Element child;
for (int i=0; i<children.size(); i++) {
child = (Element)children.get(i);
String name = child.getName();
if (name.equals("scriptFile"))
task.setScriptFile(child.getText());
else if (name.equals("execCommand"))
task.setExecCommand(child.getText());
/*
else if (name.equals("jobFolderFactory"))
config.setJobFolderFactory(
(JobFolderFactory)jobFolderFactorySerializer.read(child)
);
else if (name.equals("deleteDirectoryWhenFreed"))
config.setDeleteDirectoryWhenFreed(
child.getText().toLowerCase().equals("true")
);
*/
}
//validate:
if (task.getScriptFile() == null)
throw new IOException("RunScriptTask missing required 'scriptFile' element");
if (task.getExecCommand() == null)
throw new IOException("RunScriptTask missing required 'execCommand' element");
return task;
}