public OsmImporterData loadLayer(InputStream in, final File associatedFile, final String layerName, ProgressMonitor progressMonitor) throws IllegalDataException {
final DataSet dataSet = parseDataSet(in, progressMonitor);
if (dataSet == null) {
throw new IllegalDataException(tr("Invalid dataset"));
}
OsmDataLayer layer = createLayer(dataSet, associatedFile, layerName);
Runnable postLayerTask = createPostLayerTask(dataSet, associatedFile, layerName, layer);
return new OsmImporterData(layer, postLayerTask);
}