Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erroneous implementation of GeoServerRESTReader#existsLayer(String workspace, String name) #206

Open
dosyfier opened this issue Jan 21, 2017 · 1 comment

Comments

@dosyfier
Copy link

Seen on geoserver-manager 1.7.0.

The GeoServerRESTReader#existsLayer(String workspace, String name) method seems to be erroneously implemented since it calls:
GeoServerRESTReader#existsLayerGroup(String workspace, String name, boolean quietOnNotFound)
instead of:
GeoServerRESTReader#existsLayer(String workspace, String name, boolean quietOnNotFound)

See the GeoServerRESTReader class, line 906.

@doublebyte1
Copy link

doublebyte1 commented Mar 8, 2017

I also ran into this issue (1.7.0); it seems to be a bug, to redirect existsLayer to existsLayerGroup.

As a workaround, you call an override of this function, with an extra argument quietOnNotFound, which works.

    public boolean existsLayer(String workspace, String name, boolean quietOnNotFound){
        String url;
        if (workspace == null) {
            url = baseurl + "/rest/layers/" + name + ".xml";
        } else {
            url = baseurl + "/rest/layers/" + workspace + ":" + name + ".xml";
        }  
        String composed = Util.appendQuietOnNotFound(quietOnNotFound, url);
        return HTTPUtils.exists(composed, username, password);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants