public static WMSStoreInfo localizeWMSStore(final WMSStoreInfo info,
final Catalog catalog) throws IllegalAccessException, InvocationTargetException {
if (info==null || catalog==null)
throw new NullArgumentException("Arguments may never be null");
final WMSStoreInfo localObject=catalog.getStoreByName(info.getWorkspace(), info.getName(), WMSStoreInfo.class);
final CatalogBuilder builder = new CatalogBuilder(catalog);
if (localObject !=null){
return localObject;
}
final WMSStoreInfo createdObject = catalog.getFactory().createWebMapServer();
// let's using the created object (see getGridCoverageReader)
BeanUtils.copyProperties(createdObject, info);
createdObject.setWorkspace(localizeWorkspace(info.getWorkspace(), catalog));
builder.attach(createdObject);
return createdObject;
}