public synchronized static JGrassMapsetGeoResource addMapsetToCatalog( String locationPath, String mapsetName ) {
// URL locationId = JGrassService.createId(locationPath);
File locationFile = new File(locationPath);
try {
ID locationId = new ID(locationFile.toURI().toURL());
JGrassService location = CatalogPlugin.getDefault().getLocalCatalog()
.getById(JGrassService.class, locationId, ProgressManager.instance().get());
return location.addMapset(mapsetName);
} catch (MalformedURLException e) {
e.printStackTrace();
String message = "An error occurred while adding the mapset to the catalog";
ExceptionDetailsDialog.openError(null, message, IStatus.ERROR, JGrassPlugin.PLUGIN_ID, e);
return null;