* @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 {