}
}
logger.debug("now try to import");
try {
final ModelManager modelManager = ModelManager.getInstance();
modelManager.setChanged();
modelManager.notifyObservers(new ObserverNotification(NotificationType.startBatchProcess));
osm = new Osm2Model(pedestrian, filterCyclic);
osm.addObserver(this);
boolean missingData = false;
if (length >= 0) {
logger.debug("parse file");
osm.parseFile(inputStream, length);
} else {
missingData = osm.parseFile(inputStream);
}
setChanged();
if (osm.somethingImported()) {
logger.debug("osm.somethingImported() true");
notifyObservers(new ObserverNotification(NotificationType.done, null));
logger.debug("notified");
} else {
logger.debug("osm.somethingImported() false");
notifyObservers(new ObserverNotification(NotificationType.nothing, null));
logger.debug("notified");
}
if (!osm.wasInterrupted()) {
logger.debug("!osm.wasInterrupted()");
modelManager.setChanged();
modelManager.notifyObservers(
new ObserverNotification(
NotificationType.endBatchProcess,
new Boolean(filterDuplicateEdges),
new Boolean(missingData)
)