Package org.geowebcache

Examples of org.geowebcache.GeoWebCacheException


                return true;
            }
        }

        // REVISIT: why not simply return false if this is a query method?!
        throw new GeoWebCacheException("Format " + strFormat + " is not supported by "
                + this.getName());
    }
View Full Code Here


     * @return
     * @throws GeoWebCacheException
     */
    public Resource getFeatureInfo(ConveyorTile convTile, BoundingBox bbox, int height, int width,
            int x, int y) throws GeoWebCacheException {
        throw new GeoWebCacheException("GetFeatureInfo is not supported by this layer ("
                + getName() + ")");
    }
View Full Code Here

                                tileProto.getParameters(), resource);

                        try {
                            tileProto.getStorageBroker().put(tile);
                        } catch (StorageException e) {
                            throw new GeoWebCacheException(e);
                        }
                    }
                } catch (IOException ioe) {
                    log.error("Unable to write image tile to " + "ByteArrayOutputStream: "
                            + ioe.getMessage());
View Full Code Here

       if((idx - firstLevel + 1) < gridCoverageLevels.length) {
           // Check whether this grid is doubling
           double resolutionCheck = gridSet.gridLevels[idx].resolution / 2 - gridSet.gridLevels[idx + 1].resolution;
          
           if (Math.abs(resolutionCheck) > gridSet.gridLevels[idx + 1].resolution * 0.025) {
               throw new GeoWebCacheException("The resolution is not decreasing by a factor of two for " + this.getName());
           } else {
               GridCoverage cov = gridCoverageLevels[idx + 1];
              
               long baseX = gridLoc[0] * 2;
               long baseY = gridLoc[1] * 2;
 
View Full Code Here

                    Map<String, String> wmsParams, String expectedMimeType, Resource target)
                    throws GeoWebCacheException {
                numCalls++;
                switch (numCalls) {
                case 1:
                    throw new GeoWebCacheException("test exception");
                case 2:
                    throw new RuntimeException("test unexpected exception");
                case 3:
                    throw new GeoWebCacheException("second test exception");
                case 4:
                    throw new RuntimeException("second test unexpected exception");
                default:
                    try {
                        target.transferFrom(Channels.newChannel(new ByteArrayInputStream(
View Full Code Here

            TileLayer layer = configuration.getTileLayer(layerIdent);
            if (layer != null) {
                return layer;
            }
        }
        throw new GeoWebCacheException("Thread " + Thread.currentThread().getId()
                + " Unknown layer " + layerIdent + ". Check the logfiles,"
                + " it may not have loaded properly.");
    }
View Full Code Here

    protected BufferedImage loadMatrix(TileLayer layer, String gridSetId, int zoomLevel)
    throws IOException, GeoWebCacheException {
        File fh = new File( createFilePath(gridSetId, zoomLevel) );
       
        if(! fh.exists() || ! fh.canRead()) {
            throw new GeoWebCacheException(fh.getAbsolutePath() + " does not exist or is not readable");
        }
       
        BufferedImage img = ImageIO.read(fh);
       
        int[] widthHeight = calculateWidthHeight(layer.getGridSubset(gridSetId), zoomLevel);
       
        if(img.getWidth() != widthHeight[0] || img.getHeight() != widthHeight[1]) {
            String msg = fh.getAbsolutePath() + " has dimensions " + img.getWidth() + "," + img.getHeight()
            + ", expected " + widthHeight[0] + "," + widthHeight[1];
            throw new GeoWebCacheException(msg);
        }
       
        return img;
    }
View Full Code Here

            throws GeoWebCacheException {
        try {
            saveMatrix(filterData, layer, gridSetId, z);
           
        } catch (IOException e) {
            throw new GeoWebCacheException(this.getName()
                    + " encountered an error while persisting matrix, " + e.getMessage());
        }
       
        try {
            super.setMatrix(layer, gridSetId, z, true);
        } catch (IOException e) {
            throw new GeoWebCacheException(this.getName()
                    + " encountered an error while loading matrix, " + e.getMessage());
        }
    }
View Full Code Here

    }

   
    public void update(TileLayer layer, String gridSetId, int zoomStart, int zoomStop)
            throws GeoWebCacheException {
        throw new GeoWebCacheException("TileLayer layer, String gridSetId, int z) is not appropriate for FileRasterFilters");
    }
View Full Code Here

        try {
            getMethod = srcHelper.executeRequest(wmsUrl, requestParams, backendTimeout);

            if (getMethod.getStatusCode() != 200) {
                throw new GeoWebCacheException("Received response code "
                        + getMethod.getStatusCode() + "\n");
            }

            if (!getMethod.getResponseHeader("Content-Type").getValue().startsWith("image/")) {
                throw new GeoWebCacheException("Unexpected response content type "
                        + getMethod.getResponseHeader("Content-Type").getValue()
                        + " , request was " + urlStr + "\n");
            }

            byte[] ret = ServletUtils.readStream(getMethod.getResponseBodyAsStream(), 16384, 2048);

            InputStream is = new ByteArrayInputStream(ret);

            img = ImageIO.read(is);

        } finally {
            if (getMethod != null) {
                getMethod.releaseConnection();
            }
        }

        if (img.getWidth() != widthHeight[0] || img.getHeight() != widthHeight[1]) {
            String msg = "WMS raster filter has dimensions " + img.getWidth() + ","
                    + img.getHeight() + ", expected " + widthHeight[0] + "," + widthHeight[1]
                    + "\n";
            throw new GeoWebCacheException(msg);
        }

        return img;
    }
View Full Code Here

TOP

Related Classes of org.geowebcache.GeoWebCacheException

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.