elem.addContent(deleteWhenFreeElem);
*/
}
public SshScriptTask readTask(Element elem) throws IOException {
SshScriptTask task = new SshScriptTask(null, 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("ssh"))
task.setSessionFactory(
(SessionFactory)sshInfoSerializer.read(child)
);
else if (name.equals("scriptFile"))
task.setScriptFileName(child.getText());
else if (name.equals("execCommand"))
task.setExecutionCommand(child.getText());
/*
else if (name.equals("localFolderFactory"))
task.setLocalFolderFactory(
(JobFolderFactory)localFolderFactorySerializer.read(child)
);
else if (name.equals("remoteFolderFactory"))
task.setRemoteFolderFactory(
(RemoteFolderFactory)remoteFolderFactorySerializer.read(child)
);
else if (name.equals("deleteRemoteDirectory"))
task.setDeleteRemoteDirectory(
child.getText().toLowerCase().equals("true")
);
*/
}
//validate:
if (task.getSessionFactory() == null)
throw new MissingElementException("ssh", elem);
if (task.getScriptFileName() == null)
throw new MissingElementException("scriptFile", elem);
if (task.getExecutionCommand() == null)
throw new MissingElementException("execCommand", elem);
return task;
}