Package org.geowebcache.mime

Examples of org.geowebcache.mime.MimeType


        TileLayer tileLayer = mock(TileLayer.class);
        when(tld.getTileLayer(eq(layerName))).thenReturn(tileLayer);
        when(tileLayer.getName()).thenReturn(layerName);
        when(tileLayer.isEnabled()).thenReturn(true);

        final MimeType mimeType1 = MimeType.createFromFormat("image/png");
        final MimeType mimeType2 = MimeType.createFromFormat("image/jpeg");
        when(tileLayer.getMimeTypes()).thenReturn(Arrays.asList(mimeType1, mimeType2));

        Map<String, GridSubset> subsets = new HashMap<String, GridSubset>();
        Map<SRS, List<GridSubset>> bySrs = new HashMap<SRS, List<GridSubset>>();
View Full Code Here


        RasterMask rasterMask = new RasterMask(byLevelMasks, fullCoverage, coveredBounds);

        List<MimeType> mimeList = null;

        if (pollDef.getFormat() != null) {
            MimeType mime;
            try {
                mime = MimeType.createFromFormat(pollDef.getFormat());
                mimeList = new LinkedList<MimeType>();
                mimeList.add(mime);
            } catch (MimeException e) {
View Full Code Here

                continue;
            }
            if (layer.getMimeTypes() != null) {
                Iterator<MimeType> mimeIter = layer.getMimeTypes().iterator();
                while (mimeIter.hasNext()) {
                    MimeType mime = mimeIter.next();
                    formats.add(mime.getFormat());
                }
            } else {
                formats.add("image/png");
                formats.add("image/jpeg");
            }
View Full Code Here

                continue;
            }
            if (layer.getMimeTypes() != null) {
                Iterator<MimeType> mimeIter = layer.getInfoMimeTypes().iterator();
                while (mimeIter.hasNext()) {
                    MimeType mime = mimeIter.next();
                    formats.add(mime.getFormat());
                }
            } else {
                formats.add("text/plain");
                formats.add("text/html");
                formats.add("application/vnd.ogc.gml");
View Full Code Here

     * @return
     * @throws OutsideCoverageException
     */
    public ConveyorTile getTile(ConveyorTile tile) throws GeoWebCacheException, IOException,
            OutsideCoverageException {
        MimeType mime = tile.getMimeType();

        if (mime == null) {
            mime = this.formats.get(0);
        }

        if (!formats.contains(mime)) {
            throw new GeoWebCacheException(mime.getFormat() + " is not a supported format for "
                    + name);
        }

        String tileGridSetId = tile.getGridSetId();

        long[] gridLoc = tile.getTileIndex();

        GridSubset gridSubset = getGridSubset(tileGridSetId);
        // Final preflight check, throws exception if necessary
        gridSubset.checkCoverage(gridLoc);

        ConveyorTile returnTile;

        tile.setMetaTileCacheOnly(!gridSubset.shouldCacheAtZoom(gridLoc[2]));
        try {
            if (tryCacheFetch(tile)) {
                returnTile = finalizeTile(tile);
            } else if (mime.supportsTiling()) { // Okay, so we need to go to the backend
                returnTile = getMetatilingReponse(tile, true);
            } else {
                returnTile = getNonMetatilingReponse(tile, true);
            }
        } finally {
View Full Code Here

        GridSubset gridSubset = subSets.get(tile.getGridSetId());

        // GridCalculator gridCalc = getGrid(tile.getSRS()).getGridCalculator();

        MimeType mimeType = tile.getMimeType();
        Map<String, String> fullParameters = tile.getFullParameters();
        if (fullParameters.isEmpty()) {
            fullParameters = getDefaultParameterFilters();
        }
        WMSMetaTile metaTile = new WMSMetaTile(this, gridSubset, mimeType,
View Full Code Here

        if(iter.hasNext()){
            firstMt = (ImageMime)iter.next();
        }
        boolean outputGif = outputFormat.getInternalName().equalsIgnoreCase("gif");
        while (iter.hasNext()) {
            MimeType mt = iter.next();          
            if(outputGif){
                if (mt.getInternalName().equalsIgnoreCase("gif")) {
                    this.srcFormat = (ImageMime) mt;
                    break;
                }
            }
            if (mt.getInternalName().equalsIgnoreCase("png")) {
                this.srcFormat = (ImageMime) mt;
            }
        }
       
        if(srcFormat == null){
View Full Code Here

        if(iter.hasNext()){
            firstMt = (ImageMime)iter.next();
        }
       
        while (iter.hasNext()) {
            MimeType mt = iter.next();
            if (mt.getInternalName().equalsIgnoreCase("png")) {
                this.srcFormat = (ImageMime) mt;
                break;
            }
        }
       
View Full Code Here

    public static TileRange createTileRange(SeedRequest req, TileLayer tl)
            throws GeoWebCacheException {
        int zoomStart = req.getZoomStart().intValue();
        int zoomStop = req.getZoomStop().intValue();

        MimeType mimeType = null;
        String format = req.getMimeFormat();
        if (format == null) {
            mimeType = tl.getMimeTypes().get(0);
        } else {
            try {
View Full Code Here

                requestParameterMap, encoding, paramKeys);

        final Map<String, String> fullParameters = tileLayer.getModifiableParameters(
                requestParameterMap, encoding);

        final MimeType mimeType;
        String format = paramValues.get("format");
        try {
            mimeType = MimeType.createFromFormat(format);
        } catch (MimeException me) {
            throw new ServiceException("Unable to determine requested format, " + format);
View Full Code Here

TOP

Related Classes of org.geowebcache.mime.MimeType

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.