private void checkStyleAllowed(AccessInfo rule, String styleName) { // otherwise check if the requested style is allowed Set<String> allowedStyles = new HashSet<String>(); if (rule.getDefaultStyle() != null) { allowedStyles.add(rule.getDefaultStyle()); } if (rule.getAllowedStyles() != null) { allowedStyles.addAll(rule.getAllowedStyles()); } if ((allowedStyles.size() > 0) && !allowedStyles.contains(styleName)) { throw new ServiceException( "The '" + styleName + "' style is not available on this layer"); } }
private void checkStyleAllowed(AccessInfo rule, String styleName) { // otherwise check if the requested style is allowed Set<String> allowedStyles = new HashSet<String>(); if (rule.getDefaultStyle() != null) { allowedStyles.add(rule.getDefaultStyle()); } if (rule.getAllowedStyles() != null) { allowedStyles.addAll(rule.getAllowedStyles()); } if ((allowedStyles.size() > 0) && !allowedStyles.contains(styleName)) { throw new ServiceException( "The '" + styleName + "' style is not available on this layer"); } }
if (rule.getDefaultStyle() != null) { try { StyleInfo si = catalog.getStyleByName(rule.getDefaultStyle()); if (si == null) { throw new ServiceException( "Could not find default style suggested " + "by GeoRepository: " + rule.getDefaultStyle()); throw new ServiceException( "Unable to load the style suggested by GeoRepository: " + rule.getDefaultStyle(), e);
if (rule.getDefaultStyle() != null) { try { StyleInfo si = catalog.getStyleByName(rule.getDefaultStyle()); if (si == null) { throw new ServiceException( "Could not find default style suggested " + "by GeoRepository: " + rule.getDefaultStyle()); throw new ServiceException( "Unable to load the style suggested by GeoRepository: " + rule.getDefaultStyle(), e);
} else if ((rule.getDefaultStyle() != null)) { try { StyleInfo si = catalog.getStyleByName(rule.getDefaultStyle()); if (si == null) { throw new ServiceException( "Could not find default style suggested " + "by Geofence: " + rule.getDefaultStyle()); throw new ServiceException( "Unable to load the style suggested by Geofence: " + rule.getDefaultStyle(), e);
} else if ((rule.getDefaultStyle() != null)) { try { StyleInfo si = catalog.getStyleByName(rule.getDefaultStyle()); if (si == null) { throw new ServiceException( "Could not find default style suggested " + "by Geofence: " + rule.getDefaultStyle()); throw new ServiceException( "Unable to load the style suggested by Geofence: " + rule.getDefaultStyle(), e);