Index: WMTSCacheStruct.java
===================================================================
--- WMTSCacheStruct.java	(revision 4271)
+++ WMTSCacheStruct.java	(revision 4272)
@@ -23,6 +23,8 @@
 
 import java.awt.geom.Point2D;
 import java.awt.geom.Rectangle2D;
+import java.io.File;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -54,13 +56,13 @@
 	private List<WMTSTileMatrixLimits>    tileMatrixSetLimits = null;
 	private double[]                      pixelSize           = null;
     private RasterDataStore               store               = null;
-    
+
     public WMTSCacheStruct(RasterDataStore store, WMTSTileMatrixSetLink tileMatrixSetLink) {
     	this.store = store;
     	this.tileMatrixSet = tileMatrixSetLink.getTileMatrixSet();
 		this.tileMatrixSetLimits = tileMatrixSetLink.getTileMatrixLimits();
 		pixelSize = ((WMTSProvider)store.getProvider()).getPixelSizeByLevel();
-		serverURL = ((WMTSProvider)store.getProvider()).getURIOfFirstProvider();
+		serverURL = ((WMTSProvider)store.getProvider()).getURIOfFirstProvider().getPath();
 		layerName = ((WMTSDataParameters)store.getParameters()).getLayer().getTitle();
     }
 
@@ -115,7 +117,7 @@
 		if(tileMatrixSetLimits != null && tileMatrixSetLimits.size() > level) {
 			WMTSTileMatrixLimits l = (WMTSTileMatrixLimits)tileMatrixSetLimits.get(level);
 			return l.getMinTileRow();
-		} else 
+		} else
 			return 0;
 	}
 
@@ -158,10 +160,10 @@
 		tile.setLr(lr);
 		tile.setWidthPx(size[0]);
 		tile.setHeightPx(size[1]);
-		
-		Rectangle2D r = new Rectangle2D.Double(Math.min(ul.getX(), lr.getX()), 
-				Math.min(ul.getY(), lr.getY()), 
-				Math.abs(ul.getX() - lr.getX()), 
+
+		Rectangle2D r = new Rectangle2D.Double(Math.min(ul.getX(), lr.getX()),
+				Math.min(ul.getY(), lr.getY()),
+				Math.abs(ul.getX() - lr.getX()),
 				Math.abs(ul.getY() - lr.getY()));
 		int bufWidth = (int)(r.getWidth() / getPixelSizeByLevel(level));
 		int bufHeight = (int)(r.getHeight() / getPixelSizeByLevel(level));
@@ -169,22 +171,22 @@
 			WMTSStatus status = ((WMTSProvider)store.getProvider()).buildWMTSStatus(r, bufWidth, bufHeight);
 			tile.setDownloaderParams("WMTSStatus", status);
 		} catch (RasterDriverException e) {
-			throw new TileBuildException(e); 
+			throw new TileBuildException(e);
 		}
-			
+
 		return tile;
 	}
-	
+
 	public List<Tile> getTileList(Point2D ul, Point2D lr, double mtsPixelRequest) throws TileBuildException {
-		Rectangle2D r = new Rectangle2D.Double(Math.min(ul.getX(), lr.getX()), 
-				Math.min(ul.getY(), lr.getY()), 
-				Math.abs(ul.getX() - lr.getX()), 
+		Rectangle2D r = new Rectangle2D.Double(Math.min(ul.getX(), lr.getX()),
+				Math.min(ul.getY(), lr.getY()),
+				Math.abs(ul.getX() - lr.getX()),
 				Math.abs(ul.getY() - lr.getY()));
 		int bufWidth = (int)(r.getWidth() / mtsPixelRequest);
 		int bufHeight = (int)(r.getHeight() / mtsPixelRequest);
 		try {
 			WMTSStatus status = ((WMTSProvider)store.getProvider()).buildWMTSStatus(r, bufWidth, bufHeight);
-			
+
 			//Conversión a tiles de la librería
 			List<WMTSTile> tiles = status.getTileList();
 			List<Tile> tileList = new ArrayList<Tile>();
@@ -200,7 +202,7 @@
 			}
 			return tileList;
 		} catch (RasterDriverException e) {
-			throw new TileBuildException(e); 
+			throw new TileBuildException(e);
 		}
 	}
 
@@ -217,12 +219,12 @@
 
 	public boolean compare(CacheStruct struct) {
 		MathUtils mu = RasterLocator.getManager().getMathUtils();
-		//Compara: número de niveles, tamaño de tile, 
-		//anchoXalto de la matriz, tamaño de pixel por nivel, 
+		//Compara: número de niveles, tamaño de tile,
+		//anchoXalto de la matriz, tamaño de pixel por nivel,
 		//coordenadas de al menos un tile de la matriz
 		if(struct.getNumberOfLevels() == getNumberOfLevels()) {
 			for (int i = 0; i < getNumberOfLevels(); i++) {
-				if(	struct.getTileSizeByLevel(i)[0] == getTileSizeByLevel(i)[0] && 
+				if(	struct.getTileSizeByLevel(i)[0] == getTileSizeByLevel(i)[0] &&
 					struct.getTileSizeByLevel(i)[1] == getTileSizeByLevel(i)[1] &&
 					struct.getWorldHeightOfTileMatrixByLevel(i) == getWorldHeightOfTileMatrixByLevel(i) &&
 					struct.getWorldWidthOfTileMatrixByLevel(i) == getWorldWidthOfTileMatrixByLevel(i) &&
@@ -234,7 +236,7 @@
 		}
 		return false;
 	}
-	
+
 	private boolean compareExtents(Point2D[] p, Point2D[] p1) {
 		return (p[0].getX() == p1[0].getX() && p[0].getY() == p1[0].getY() &&
 				p[1].getX() == p1[1].getX() && p[1].getY() == p1[1].getY());
@@ -247,7 +249,7 @@
 		return null;*/
 		return ((WMTSProvider)store.getProvider()).getSRSCode();
 	}
-	
+
 	private String getDimension() {
 		WMTSDataParameters p = (WMTSDataParameters)(((WMTSProvider)store.getProvider()).getDataParameters());
 		String dimension = p.getDimension();
