Index: RasterProvider.java
===================================================================
--- RasterProvider.java	(revision 4180)
+++ RasterProvider.java	(revision 4181)
@@ -24,8 +24,11 @@
 import java.awt.Image;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Point2D;
+import java.io.File;
+import java.net.URI;
 
 import org.cresques.cts.IProjection;
+
 import org.gvsig.compat.net.ICancellable;
 import org.gvsig.fmap.dal.coverage.dataset.Buffer;
 import org.gvsig.fmap.dal.coverage.datastruct.Extent;
@@ -57,14 +60,14 @@
 /**
  * This interface have to be implemented by a raster data source. Is used by a store to
  * provide services from a specific source.
- * 
+ *
  * @author Nacho Brodin (nachobrodin@gmail.com)
  *
  */
 public interface RasterProvider extends CoverageStoreProvider, Histogramable {
-	
+
 	public void reload();
-	
+
 	/**
 	 * Gets a list of sizes. If the provider doesn't have files it will return null.
 	 * If the provider has one file it will return an array of one element with the
@@ -72,27 +75,27 @@
 	 * @return
 	 */
 	public long[] getFileSizeByProvider();
-	
+
 	/**
-	 * Gets a list of file names or URI. Each element of this array is the name of a 
-	 * provider 
+	 * Gets a list of file names or URI. Each element of this array is the name of a
+	 * provider
 	 * @return
 	 */
-	public String[] getURIByProvider();
-	
+	public URI[] getURIByProvider();
+
 	/**
 	 * Gets the URI of the first provider.
-	 * @return String 
+	 * @return String
 	 *         File name or URI
 	 */
-	public String getURIOfFirstProvider();
-	
+	public URI getURIOfFirstProvider();
+
 	/**
-	 * Gets the number of bands by provider. 
+	 * Gets the number of bands by provider.
 	 * @return
 	 */
 	public int[] getBandCountByProvider();
-	
+
 	/**
 	 * Selecting a number of band this function returns the number of band
 	 * inside the file. If this provider has only one file the result
@@ -101,20 +104,20 @@
 	 * @return
 	 */
 	public int getBandPositionByProvider(int band);
-	
+
 	/**
 	 * Returns the number of internal providers that it has
 	 * @return
 	 */
 	public int getInternalProviderCount();
-	
+
 	/**
 	 * Gets the internal provider of the i position
 	 * @param i
 	 * @return
 	 */
 	public RasterProvider getInternalProvider(int i);
-	
+
 	/**
 	 * Gets the URI of the source. If the provider has only one band
 	 * the result will be the URI. If it is multifile will have to choose
@@ -122,47 +125,47 @@
 	 * @param band
 	 * @return
 	 */
-	public String getURIByBand(int band);
-	
+	public URI getURIByBand(int band);
+
 	/**
 	 * Gets the uniform resource identifier
 	 * @return
 	 */
-	public String getURI();
-	
+	public URI getURI();
+
 	/**
 	 * Gets the number of subdatasets
 	 * @return
 	 */
 	public int getSubdatasetCount();
-	
+
 	/**
-	 * Adds a new file. The behavior of this function depends on 
+	 * Adds a new file. The behavior of this function depends on
 	 * the kind of provider and its implementation.
 	 * @param file
-	 * @throws InvalidSourceException 
+	 * @throws InvalidSourceException
 	 */
-	public void addFile(String file) throws InvalidSourceException;
-	
+	public void addFile(File file) throws InvalidSourceException;
+
 	/**
-	 * Removes a file. The behavior of this function depends on 
+	 * Removes a file. The behavior of this function depends on
 	 * the kind of provider and its implementation.
 	 * @param file
 	 */
-	public void removeFile(String file);
-	
+	public void removeFile(File file);
+
 	/**
 	 * Obtiene el número de bandas del raster
 	 * @return Número de bandas
 	 */
 	public int getBandCount();
-	
+
 	/**
 	 * Obtiene el tipo de dato por banda
 	 * @return tipo de dato por banda
 	 */
 	public int[] getDataType();
-	
+
 	/**
 	 * Obtiene la altura del raster en píxeles.
 	 * @return altura
@@ -174,42 +177,42 @@
 	 * @return anchura
 	 */
 	public double getWidth();
-	
+
 	/**
 	 * Devuelve si el Dataset es reproyectable
 	 * @return
 	 */
 	public boolean isReproyectable();
-	
+
 	/**
 	 * Returns true if this raster has rotation and false if don't
 	 */
 	public boolean isRotated();
-	
+
 	/**
 	 * Returns true if this provider is open and false if don't
 	 * @return
 	 */
 	public boolean isOpen();
-	
+
 	/**
 	 * Returns true if this provider supports time.
 	 * @return
 	 */
 	public boolean isTimeSupported();
-	
+
 	/**
 	 * Returns true if the provider support tiles
 	 * @return
 	 */
 	public boolean isTiled();
-	
+
 	/**
 	 * Informa de si el dataset soporta overviews o no.
 	 * @return true si soporta overviews y false si no las soporta.
 	 */
 	public boolean isOverviewsSupported();
-	
+
 	/**
 	 * Obtiene el número de overviews de una banda
 	 * @return
@@ -228,7 +231,7 @@
 	 */
 	public int getOverviewHeight(int band, int overview) throws BandAccessException, RasterDriverException;
 
-	
+
 	/**
 	 * Informa de si el punto en coordenadas del mundo real pasado por parámetro cae dentro del
 	 * raster o fuera. Para este calculo cogeremos el punto a averiguar si está dentro del raster
@@ -238,38 +241,38 @@
 	 * @return true si el punto está dentro y false si está fuera.
 	 */
 	public boolean isInside(Point2D p);
-	
+
 	/**
 	 * Gets the nodata value.
 	 * @return
 	 */
 	public NoData getNoDataValue();
-	
+
 	/**
 	 * Gets statistics of this provider
 	 * @return MultiFileStatistics
 	 */
 	public Statistics getStatistics();
-	
+
 	/**
-	 * Sets the statistics of this provider. Be careful using this method. 
-	 * Statistics shouldn't be assigned unless you had cloned this provider. 
-	 * @throws RmfSerializerException 
+	 * Sets the statistics of this provider. Be careful using this method.
+	 * Statistics shouldn't be assigned unless you had cloned this provider.
+	 * @throws RmfSerializerException
 	 */
 	public void setStatistics(Statistics stats) throws RmfSerializerException;
-	
+
 	/**
 	 * Obtiene el extent del raster.
 	 * @return Extent
 	 */
 	public Extent getExtent();
-	
+
 	/**
-	 * Gets the suffix of the source file 
+	 * Gets the suffix of the source file
 	 * @return
 	 */
 	public String getFileSuffix();
-	
+
 	/**
 	 * Este es el extent sobre el que se ajusta una petición para que esta no
 	 * exceda el extent máximo del raster. Para un raster sin rotar será igual al
@@ -280,7 +283,7 @@
 	 * @return Extent
 	 */
 	public Extent getExtentWithoutRot();
-	
+
 	/**
 	 * Obtiene la matriz de transformación del propio raster. Esta matriz es la
 	 * encargada de convertir las coordenadas de la petición en coordenadas a las
@@ -293,7 +296,7 @@
 	 * @return
 	 */
 	public AffineTransform getOwnAffineTransform();
-	
+
 	/**
 	 * Obtiene la transformación afin aplicada en las peticiones con coordenadas
 	 * reales. Esta corresponde al producto matricial entre la transformación de
@@ -303,92 +306,92 @@
 	 * @return Matriz de la transformación afín.
 	 */
 	public AffineTransform getAffineTransform();
-	
+
 	/**
 	 * Sets the provider projection
 	 * @return IProjection
 	 */
 	public IProjection getProjection();
-	
+
 	/**
 	 * Gets the provider projection
 	 * @return IProjection
 	 */
 	public void setProjection(IProjection proj, boolean persist) throws RmfSerializerException;
-	
+
 	/**
 	 * Obtiene el extent asignado
 	 * @return	Extent
 	 */
 	public Extent getView();
-	
+
 	/**
 	 * Gets a DatasetMetadata object
 	 * @return
 	 */
 	public Metadata getMetadata();
-	
+
 	/**
 	 * Gets the object with the color interpretation by band
 	 * @return ColorInterpretation
 	 */
 	public ColorInterpretation getColorInterpretation();
-	
+
 	/**
 	 * Assigns the object with the color interpretation by band
 	 * @param ci
 	 */
 	public void setColorInterpretation(ColorInterpretation ci);
-	
+
 	/**
 	 * Define el objeto paleta. Si se define null quiere decir que no tiene paleta
 	 * para su visualización.
 	 * @param value
 	 */
 	public void setColorTable(ColorTable value);
-	
+
 	/**
 	 * Gets the {@link ColorTable} or null if the raster
 	 * does not have
 	 * @return
 	 */
 	public ColorTable getColorTable();
-	
+
 	/**
 	 * Gets the legend as a image. The store could not have implemented this method .
-	 * This is useful above all for WMS but whatever raster layer 
+	 * This is useful above all for WMS but whatever raster layer
 	 * could return a legend as image.
 	 * @return
 	 */
 	public Image getImageLegend();
-	
+
 	/**
 	 * Obtiene el estado de transparencia a partir de los estados de transparencia de todos
-	 * los ficheros que lo componen. Si varios de los ficheros que lo componen tienen banda de 
+	 * los ficheros que lo componen. Si varios de los ficheros que lo componen tienen banda de
 	 * transparencia estas tendrán que ser mezcladas sobre una banda de transparencia única.
 	 * @return Objeto FileTransparency con el estado de transparencia
 	 */
 	public Transparency getTransparency();
-	
+
 	/**
 	 * Cierra los raster asociados.
 	 */
 	public void close();
-	
+
 	/**
 	 * Convierte un punto desde coordenadas pixel a coordenadas del mundo.
 	 * @param pt Punto a transformar
 	 * @return punto transformado en coordenadas del mundo
 	 */
 	public Point2D rasterToWorld(Point2D pt);
-	
+
 	/**
 	 * Convierte un punto desde del mundo a coordenadas pixel.
 	 * @param pt Punto a transformar
 	 * @return punto transformado en coordenadas pixel
 	 */
 	public Point2D worldToRaster(Point2D pt);
-	
+
 	/**
 	 * Asigna una transformación al raster para que se tenga en cuenta en la
 	 * asignación del setView. Esta asignación recalcula el extent, el
@@ -398,13 +401,13 @@
 	 * @param t Transformación afín a aplicar
 	 */
 	public void setAffineTransform(AffineTransform t);
-	
+
 	/**
 	 * Gets the pixel size
 	 * @return
 	 */
 	public double getCellSize();
-	
+
 	/**
 	 * Obtiene el tamaño de pixel en X
 	 * @return tamaño de pixel en X
@@ -416,7 +419,7 @@
 	 * @return tamaño de pixel en Y
 	 */
 	public double getPixelSizeY();
-	
+
 	/**
 	 * Obtiene el valor del raster en la coordenada que se le pasa.
 	 * El valor será Double, Int, Byte, etc. dependiendo del tipo de
@@ -428,65 +431,65 @@
 	public Object getData(int x, int y, int band)throws InvalidSetViewException, FileNotOpenException, RasterDriverException;
 
 	/**
-	 * Obtiene la proyección asociada al raster. Como todos los dataset del 
+	 * Obtiene la proyección asociada al raster. Como todos los dataset del
 	 * multiDataset deben tener la misma proyección obtenemos esta del primer
 	 * dataset.
 	 * @return Proyección en formato cadena
 	 * @throws RasterDriverException
 	 */
 	public String getWktProjection() throws RasterDriverException;
-	
+
 	/**
 	 * Sets the nodata value
 	 * @return
 	 */
 	public void setNoDataValue(NoData value);
-	
+
 	/**
 	 * Obtiene el flag que dice si el raster está o no georreferenciado
 	 * @return true si está georreferenciado y false si no lo está.
 	 */
 	public boolean isGeoreferenced();
-	
+
 	/**
 	 * Returns true if the provider has several files and all of them has the same extension
 	 * @return
 	 */
 	public boolean isMultiFile();
-	
+
 	/**
 	 * Returns true if the source of data is a mosaic of images
 	 * @return
 	 */
 	public boolean isMosaic();
-	
+
 	/**
 	 * Deletes the cache of this layer composed by the files in the provider list
 	 */
 	public void deleteLayerFromCache();
-	
+
 	/**
 	 * Clone this RasterProvider
 	 * @return
 	 */
 	public RasterProvider cloneProvider() throws CloneException;
-	
+
 	/**
 	 * Returs the DataParameters
 	 * @return
 	 */
 	public RasterDataParameters getDataParameters();
-	
+
 	/**
 	 * Reads a complete block of data and returns an tridimensional array of the right type. This function is useful
-	 * to read a file very fast without setting a view. 
+	 * to read a file very fast without setting a view.
 	 * @deprecated This method is only used to generate statistics. The statistics have to change the way in
 	 * which are calculated. Then this function will be eliminated.
 	 */
 	public Object readBlock(int pos, int blockHeight, double scale)
 		throws InvalidSetViewException, FileNotOpenException, RasterDriverException, ProcessInterruptedException;
 
-	
+
 	/**
 	 * Carga un objecto desde un serializador usando el tipo del mismo objeto pasado por parametro.
 	 * Usa value para iniciar dicho serializador
@@ -496,36 +499,36 @@
 	 * @throws RmfSerializerException
 	 */
 	public Object loadObjectFromRmf(Class<?> class1, Object value) throws RmfSerializerException;
-	
+
 	/**
 	 * Guarda en el RMF el objecto actual en caso de que exista un serializador para el.
 	 * El tipo del objeto se especifica en el parametro class1.
 	 * Esto nos puede permitir poder poner a null un valor y encontrar su serializador.
 	 * @param class1
 	 * @param value
-	 * @throws RmfSerializerException 
+	 * @throws RmfSerializerException
 	 */
 	public void saveObjectToRmf(Class<?> class1, Object value) throws RmfSerializerException;
-	
+
 	/**
 	 * Sets the status information using other provider of the same type. The first action
 	 * of this method should be to check the type of the parameter.
 	 * @param provider
 	 */
 	public void setStatus(RasterProvider provider);
-	
+
 	/**
 	 * Gets the information in a real point
 	 * @param x
 	 * @param y
 	 * @return
-	 * @throws RemoteServiceException 
+	 * @throws RemoteServiceException
 	 */
 	public String getInfoByPoint(double x, double y, ICancellable cancellable) throws InfoByPointException;
-	
+
 	/**
-	 * Gets the information in a pixel point. Some services need additional 
-	 * information as the window where the request is done 
+	 * Gets the information in a pixel point. Some services need additional
+	 * information as the window where the request is done
 	 * @param x
 	 *        X Pixel position
 	 * @param y
@@ -541,63 +544,63 @@
 	 * @throws RemoteServiceException
 	 */
 	public String getInfoByPoint(int x, int y, Extent bbox, int w, int h, ICancellable cancellable) throws InfoByPointException;
-	
+
 	/**
 	 * Gets the tile cache data server
 	 * @return
 	 */
 	public TileServer getTileServer();
-	
+
 	/**
-	 * Some services neither has limits nor pixel size. For instance, WebMapService 
+	 * Some services neither has limits nor pixel size. For instance, WebMapService
 	 * is a service of this type if the size is not fixed. Other services, like
 	 * WMTS are enclosed too but in this case it will have resolution by level.
 	 * This method returns true if the data source is enclosed.
 	 * @return
 	 */
 	public boolean isRasterEnclosed();
-	
+
 	/**
 	 * Gets the rmf file path. This method will have to be redefined by providers
 	 * with a different path
 	 * @return
 	 */
-	public String getRMFFile();
-	
+	public File getRMFFile();
+
 	/**
 	 * Selects the subdataset.
 	 */
 	public void selectSubdataset();
-	
+
 	/**
 	 * Gets the list of supported formats
 	 * @return
 	 */
 	public String[] getFormatList();
-	
+
 	/**
 	 * Returns the source type (FILE, POSTGIS, REMOTE,...)
 	 * @return
 	 */
 	public int getSourceType();
-	
+
 	/**
 	 * This function returns true if the image to be loaded needs a enhanced filter or
 	 * doesn't. It depends on the format, number of bands, type of data and so on.
 	 * @return The default value is false but each driver can change this value.
 	 */
 	public boolean needEnhanced();
-	
+
 	/**
 	 * Gets the time serial information
 	 * @return
-	 * @throws RmfSerializerException 
+	 * @throws RmfSerializerException
 	 */
 	public TimeSeries getTimeSerials() throws RmfSerializerException;
-	
+
 	/**
 	 * Sets the time serial information
-	 * @throws RmfSerializerException 
+	 * @throws RmfSerializerException
 	 */
 	public void setTimeSerials(TimeSeries serialInfo) throws RmfSerializerException;
 
@@ -605,20 +608,20 @@
 	 * Gets the set of data selected in the {@link RasterQuery}
 	 * @param q
 	 * @return
-	 * @throws RasterDriverException 
-	 * @throws ProcessInterruptedException 
+	 * @throws RasterDriverException
+	 * @throws ProcessInterruptedException
 	 */
 	public Buffer getDataSet(SpiRasterQuery query) throws ProcessInterruptedException, RasterDriverException;
-	
+
 	/**
 	 * Gets the list of geo points associated to this provider
 	 * @return
 	 */
 	public GeoPointList getGeoPointList();
-	
+
 	/**
 	 * Sets the list of geo points associated to this provider
 	 */
 	public void setGeoPointList(GeoPointList geoPointList);
-	
+
 }
