Revision 4436 org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/AbstractRasterProvider.java

View differences:

AbstractRasterProvider.java
173 173
                    setFileSize(f.length());
174 174
                }
175 175
            }
176
            uri = translateURI(uri);
176 177
        }
177 178

  
178 179
        ownTransformation = new AffineTransform();
......
265 266

  
266 267
	/**
267 268
	 * Factoria para abrir distintos tipos de raster.
268
	 * @param fName Nombre del fichero.
269
	 * @param storeServices
270
	 * @param param
269 271
	 *
270 272
	 * @return SingleDataset, o null si hay problemas.
273
	 * @throws RasterDriverException
271 274
	 */
272 275
	@SuppressWarnings("unchecked")
273 276
	public static AbstractRasterProvider singleDatasetInstance(DataStoreProviderServices storeServices, String param) throws RasterDriverException {
......
316 319
	/**
317 320
	 * Carga un fichero raster. Puede usarse para calcular el extent e instanciar
318 321
	 * un objeto de este tipo.
322
	 * @return RasterProvider
319 323
	 */
320 324
	abstract public RasterProvider load();
321 325

  
......
349 353
	 * raster.
350 354
	 * @param x	coordenada X
351 355
	 * @param y coordenada Y
352
	 * @return
356
	 * @return data
353 357
	 */
354 358
	abstract public Object getData(int x, int y, int band)throws InvalidSetViewException, FileNotOpenException, RasterDriverException;
355 359

  
356 360
	/**
357 361
	 * Gets the set of data selected in the {@link RasterQuery}
358 362
	 * @param q
359
	 * @return
363
	 * @return buffer
360 364
	 * @throws RasterDriverException
361 365
	 * @throws ProcessInterruptedException
362 366
	 */
......
486 490
		if(noData == null) {
487 491
			noData = RasterLocator.getManager().getDataStructFactory().createDefaultNoData(getBandCount(), getDataType()[0]);
488 492
			noData.setNoDataTransparent(false);
489
			noData.setFileName(getRMFFile().getName());
493
			File rmfFile = getRMFFile();
494
			if(rmfFile!=null){
495
			    noData.setFileName(rmfFile.getName());
496
			}
490 497
		}
491 498
		return noData;
492 499
	}
......
557 564

  
558 565
	/**
559 566
	 * Asigna el par?metro de inicializaci?n del driver.
567
	 * @param provServices
568
	 * @param param
560 569
	 */
561 570
	public void setParam(DataStoreProviderServices provServices, DataStoreParameters param) {
562 571
		if(param instanceof RasterDataParameters)
......
605 614
        if ("FILE".equalsIgnoreCase(objUri.getScheme())) {
606 615
            file = new File(objUri);
607 616
            fileName = FilenameUtils.getBaseName(objUri.getPath());
608
        } else {
609
            file = new File(objUri.getHost());
610
            fileName = FilenameUtils.getBaseName(objUri.getHost());
611
        }
612
        if (rmfFolder == null) {
613
            rmfFolder = file.getParentFile();
614
            if ((getDataParameters() != null && getDataParameters() instanceof RasterDataParameters)) {
615
                ((RasterDataParameters) getDataParameters()).setRMFFolder(rmfFolder);
617
            if (rmfFolder == null) {
618
                rmfFolder = file.getParentFile();
619
                if ((getDataParameters() != null && getDataParameters() instanceof RasterDataParameters)) {
620
                    ((RasterDataParameters) getDataParameters()).setRMFFolder(rmfFolder);
621
                }
622
//                return new File(fileName + tail);
616 623
            }
617
            return new File(fileName + tail);
618
        } else {
619 624
            return new File(rmfFolder.getAbsolutePath() + File.separator + fileName + tail);
620 625
        }
626
        return null;
621 627
    }
622 628

  
623 629
	protected String getRMFFileForRemoteServices(String layerName) {
......
673 679

  
674 680
	/**
675 681
	 * Devuelve si el Dataset es reproyectable
676
	 * @return
682
	 * @return true if Dataset is reproyectable
677 683
	 */
678 684
	public boolean isReproyectable() {
679 685
		return true;
......
734 740
	 * @param file
735 741
	 * @param class1
736 742
	 * @param value
737
	 * @return
743
	 * @return Object
738 744
	 * @throws RmfSerializerException
739 745
	 */
740 746
	public static Object loadObjectFromRmfFile(String file, Class<?> class1, Object value) throws RmfSerializerException {
......
756 762
	 * Carga un objecto desde un serializador usando el tipo del mismo objeto pasado por parametro.
757 763
	 * Usa value para iniciar dicho serializador
758 764
	 * @param value
759
	 * @return
765
	 * @return Object
760 766
	 * @throws RmfSerializerException
761 767
	 */
762 768
	public Object loadObjectFromRmf(Object value) throws RmfSerializerException {
......
861 867

  
862 868
	/**
863 869
	 * Returs the DataParameters
864
	 * @return
870
	 * @return the DataParameters
865 871
	 */
866 872
	public RasterDataParameters getDataParameters() {
867 873
		if(getDataStoreParameters() instanceof RasterDataParameters)
......
892 898
	 * Cuando es traducido por un alias el driver intentar� abrir el alias y no el
893 899
	 * fichero. Esto es util porque algunos formatos tienen la extensi�n en el
894 900
	 * fichero de cabecera pero lo que se abre realmente es el fichero de datos.
895
	 * @param fileName
896
	 * @return
901
	 * @param uri
902
	 * @return uri
897 903
	 */
898 904
	public URI translateURI(URI uri) {
899 905
	    return uri;
......
908 914

  
909 915

  
910 916
	public String getFileSuffix() {
911
	    //FIXME: ?Sirve para algo?
912 917
		String path = getURIOfFirstProvider().getPath();
913
        return path.substring(path.lastIndexOf(".") + 1, path.length());
918
        return FilenameUtils.getExtension(path);
914 919
	}
915 920

  
916 921
	public URI getURIOfFirstProvider() {
......
949 954

  
950 955
	/**
951 956
	 * Gets the size of the file if exists in Bytes
952
	 * @return
957
	 * @return the size of file
953 958
	 */
954 959
	public long getFileSize() {
955 960
		return fileSize;
......
986 991
	 * Elimina la matriz de transformaci�n asociada al raster y que se tiene en
987 992
	 * cuenta para el setView. Este reseteo tendr� en cuenta que si el raster
988 993
	 * tiene asociado un rmf esta transformaci�n no ser� eliminada sino que se
989
	 * asignar� la correspondiente al rmf existente.
990
	 * @return devuelve true si tiene fichero rmf asociado y false si no lo tiene.
994
	 * asignar? la correspondiente al rmf existente.
991 995
	 */
992 996
	public void resetAffineTransform() {
993 997
		externalTransformation.setToIdentity();
......
1137 1141

  
1138 1142
	/**
1139 1143
	 * Gets the list of geo points associated to this provider
1140
	 * @return
1144
	 * @return the list of geo points
1141 1145
	 */
1142 1146
	public GeoPointList getGeoPointList() {
1143 1147
		return geoPointList;
......
1152 1156

  
1153 1157
	/**
1154 1158
	 * @deprecated This method should not be used. The store have a getDefaultBandList
1155
	 * @return
1159
	 * @return BandList
1156 1160
	 */
1157 1161
	public BandList getDefaultBandList() {
1158 1162
		BandList bandList = new BandListImpl();

Also available in: Unified diff