log.debug("FileName: " + fileName);
log.debug("Length of File: " + file.length);
log.debug("HasUnits is: " + hasUnits.isBool());
if (fileName.endsWith("mm")) {
InputStream istream = new ByteArrayInputStream(this.file);
ObjectiveTree newtree = new TreeLoader().loadFreeMindStream(
istream, this.hasUnits.isBool(), true);
if (newtree == null) {
log.debug("File is corrupted and new Tree cannot be built");
FacesMessages.instance().add(FacesMessage.SEVERITY_ERROR, "This is not a valid Freemind file, maybe it is corrupted. Please make sure you added at least one level of nodes to the midmap.");
return null;
}
// delete old tree
nodesToDelete.add(selectedPlan.getTree().getRoot());
selectedPlan.getTree().setRoot(newtree.getRoot());
// make sure all scales are set according to measurement infos
selectedPlan.getTree().adjustScalesToMeasurements(descriptor);
selectedPlan.getTree().setWeightsInitialized(false);
} else if ("".equals(fileName)) {