}
} catch (FactoryException fe) {
LOGGER.log(Level.WARNING,
"Error while getting EPSG code from FeatureType", fe);
throw new ServiceException(fe);
} catch (IOException ioe) {
LOGGER.log(Level.WARNING,
"Error while writing featuretype '" + schema.getTypeName() + "' to shapefile.", ioe);
throw new ServiceException(ioe);
} finally {
// close all writers, dispose all datastores, even if an exception occurs
// during closeup (shapefile datastore will have to copy the shapefiles, that migh
// fail in many ways)
IOException stored = null;
for (StoreWriter sw : writers.values()) {
try {
sw.writer.close();
sw.dstore.dispose();
} catch(IOException e) {
stored = e;
}
}
// if an exception occurred make the world aware of it
if(stored != null)
throw new ServiceException(stored);
}
return shapefileCreated;
}