layer.setName(sName);
return layer;
}
public DataStore createDatastore(String m_sFilename, SimpleFeatureType m_FeatureType) throws IOException {
WPSResourceManager manager = GeoServerExtensions.bean(WPSResourceManager.class);
File directory = IOUtils.createTempDirectory("sxttmp");
File file = new File(directory, m_sFilename);
try {
ShapefileDataStore dataStore = new ShapefileDataStore(DataUtilities.fileToURL(file));
dataStore.createSchema(m_FeatureType);
manager.addResource(new ShapefileResource(dataStore, directory));
return dataStore;
} catch(Throwable t) {
LOGGER.log(Level.SEVERE, "Could not create shapefile output ", t);
IOUtils.delete(directory);