fix #80: Considering several layers with the same name
This commit is contained in:
parent
51fac5a674
commit
71132e3b9e
@ -476,6 +476,8 @@ public class GeoServerRESTReader {
|
||||
|
||||
/**
|
||||
* Get detailed info about a given Layer.
|
||||
*
|
||||
* @deprecated use {@link #getLayer(String, String)}
|
||||
*
|
||||
* @param name The name of the Layer
|
||||
* @return Layer details as a {@link RESTLayer}
|
||||
@ -488,6 +490,25 @@ public class GeoServerRESTReader {
|
||||
return RESTLayer.build(load(url));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get detailed info about a given Layer.
|
||||
*
|
||||
* @param workspace the workspace name
|
||||
* @param name the layer name
|
||||
* @return a RESTLayer with layer information or null
|
||||
*/
|
||||
public RESTLayer getLayer(String workspace, String name) {
|
||||
if (workspace == null || workspace.isEmpty())
|
||||
throw new IllegalArgumentException("Workspace may not be null");
|
||||
if (name == null || name.isEmpty())
|
||||
throw new IllegalArgumentException("Layername may not be null");
|
||||
String url = HTTPUtils.append("/rest/layers/",workspace,":",name,".xml").toString();
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug("### Retrieving layer from " + url);
|
||||
}
|
||||
return RESTLayer.build(load(url));
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//=== NAMESPACES
|
||||
//==========================================================================
|
||||
|
||||
Loading…
Reference in New Issue
Block a user