Package com.boundlessgeo.geoserver.api.exceptions

Examples of com.boundlessgeo.geoserver.api.exceptions.NotFoundException


    }

    protected WorkspaceInfo findWorkspace(String wsName, Catalog cat) {
        WorkspaceInfo ws = cat.getWorkspaceByName(wsName);
        if (ws == null) {
            throw new NotFoundException(String.format("No such workspace %s", wsName));
        }
        return ws;
    }
View Full Code Here


    }

    protected LayerInfo findLayer(String wsName, String name, Catalog cat) {
        LayerInfo l = cat.getLayerByName(wsName+":"+name);
        if( l == null ){
            throw new NotFoundException(String.format("No such layer %s:%s", wsName, name));
        }
        return l;
    }
View Full Code Here

    }

    protected StoreInfo findStore(String wsName, String name, Catalog cat) {
        StoreInfo s = cat.getStoreByName(wsName, name, StoreInfo.class);
        if (s == null) {
            throw new NotFoundException(String.format("No such store %s:%s", wsName, name));
        }
        return s;
    }
View Full Code Here

    }

    protected LayerGroupInfo findMap(String wsName, String name, Catalog cat) {
        LayerGroupInfo m = cat.getLayerGroupByName(wsName, name);
        if (m == null) {
            throw new NotFoundException(String.format("No such map %s:%s", wsName, name));
        }
        return m;
    }
View Full Code Here

        GeoServerResourceLoader rl = geoServer.getCatalog().getResourceLoader();
        Resource resource = rl.get(Paths.path("workspaces",ws.getName(),"styles",icon));

        if( resource.getType() != Type.RESOURCE ){
            throw new NotFoundException("Icon "+icon+" not found");
        }
        String ext = fileExt(icon);
        if( !ICON_FORMATS.containsKey(ext)){
            throw new NotFoundException("Icon "+icon+" format unsupported");
        }
        String mimeType = ICON_FORMATS.get(ext.toLowerCase());

        response.setContentType(mimeType);
        //response.setStatus(HttpServletResponse.SC_OK);
View Full Code Here

        WorkspaceInfo ws = findWorkspace(wsName, catalog());

        GeoServerResourceLoader rl = geoServer.getCatalog().getResourceLoader();
        Resource resource = rl.get(Paths.path("workspaces",ws.getName(),"styles",icon));
        if( resource.getType() != Type.RESOURCE ){
            throw new NotFoundException("Icon "+icon+" not found");
        }
        String ext = fileExt(icon);
        if( !ICON_FORMATS.containsKey(ext)){
            throw new NotFoundException("Icon "+icon+" format unsupported");
        }
        return resource.delete();
    }
View Full Code Here

        catch(Exception e1) {
            throw new BadRequestException("Bad srs: " + srs, e1);
        }

        if (crs == null) {
            throw new NotFoundException("No such projection: " + srs);
        }

        return IO.proj(new JSONObj(), crs, srs);
    }
View Full Code Here

        throws IOException {
        Catalog cat = geoServer.getCatalog();
        LayerInfo l = findLayer(wsName, name, cat);
        StyleInfo s = l.getDefaultStyle();
        if (s == null) {
            throw new NotFoundException(String.format("Layer %s:%s has no default style", wsName, name));
        }

        // if the style is already stored in ySLD format just pull it directly, otherwise encode the style
        if (YsldHandler.FORMAT.equalsIgnoreCase(s.getFormat())) {
            return dataDir().style(s);
View Full Code Here

                .put("level","user")
                .put("required",true);
            return obj;
        }

        throw new NotFoundException("Unrecognized format: " + name);
    }
View Full Code Here

            throw new BadRequestException("Request must contain task identifier");
        }

        final ImportTask task = imp.task(t);
        if (task == null) {
            throw new NotFoundException("No such task: " + t + " for import: " + id);
        }

        ResourceInfo resource = task.getLayer().getResource();

        if (task.getState() == ImportTask.State.NO_CRS) {
View Full Code Here

TOP

Related Classes of com.boundlessgeo.geoserver.api.exceptions.NotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.