001 //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/model/coverage/grid/RawDataReader.java $ 002 /*---------------------------------------------------------------------------- 003 This file is part of deegree, http://deegree.org/ 004 Copyright (C) 2001-2009 by: 005 Department of Geography, University of Bonn 006 and 007 lat/lon GmbH 008 009 This library is free software; you can redistribute it and/or modify it under 010 the terms of the GNU Lesser General Public License as published by the Free 011 Software Foundation; either version 2.1 of the License, or (at your option) 012 any later version. 013 This library is distributed in the hope that it will be useful, but WITHOUT 014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 015 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 016 details. 017 You should have received a copy of the GNU Lesser General Public License 018 along with this library; if not, write to the Free Software Foundation, Inc., 019 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 020 021 Contact information: 022 023 lat/lon GmbH 024 Aennchenstr. 19, 53177 Bonn 025 Germany 026 http://lat-lon.de/ 027 028 Department of Geography, University of Bonn 029 Prof. Dr. Klaus Greve 030 Postfach 1147, 53001 Bonn 031 Germany 032 http://www.geographie.uni-bonn.de/deegree/ 033 034 e-mail: info@deegree.org 035 ----------------------------------------------------------------------------*/ 036 package org.deegree.model.coverage.grid; 037 038 import java.io.IOException; 039 import java.io.InputStream; 040 041 import org.deegree.datatypes.parameter.GeneralParameterValueIm; 042 import org.deegree.datatypes.parameter.InvalidParameterNameException; 043 import org.deegree.datatypes.parameter.InvalidParameterValueException; 044 import org.deegree.datatypes.parameter.ParameterNotFoundException; 045 import org.deegree.model.spatialschema.Envelope; 046 import org.deegree.ogcwebservices.wcs.configuration.File; 047 import org.deegree.ogcwebservices.wcs.describecoverage.CoverageOffering; 048 049 /** 050 * 051 * 052 * @version $Revision: 18195 $ 053 * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a> 054 * @author last edited by: $Author: mschneider $ 055 * 056 * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $ 057 */ 058 public class RawDataReader extends AbstractGridCoverageReader { 059 060 /** 061 * @param source 062 * @param description 063 * @param format 064 */ 065 public RawDataReader( File source, CoverageOffering description, Format format ) { 066 super( source, description, source.getEnvelope(), format ); 067 } 068 069 /** 070 * @param source 071 * @param description 072 * @param envelope 073 * @param format 074 */ 075 public RawDataReader( InputStream source, CoverageOffering description, Envelope envelope, Format format ) { 076 super( source, description, envelope, format ); 077 } 078 079 /** 080 * Read the grid coverage from the current stream position, and move to the next grid coverage. 081 * 082 * @param parameters 083 * An optional set of parameters. Should be any or all of the parameters returned by 084 * {@link "org.opengis.coverage.grid.Format#getReadParameters"}. 085 * @return A new {@linkplain GridCoverage grid coverage} from the input source. 086 * @throws InvalidParameterNameException 087 * if a parameter in <code>parameters</code> doesn't have a recognized name. 088 * @throws InvalidParameterValueException 089 * if a parameter in <code>parameters</code> doesn't have a valid value. 090 * @throws ParameterNotFoundException 091 * if a parameter was required for the operation but was not provided in the 092 * <code>parameters</code> list. 093 * @throws IOException 094 * if a read operation failed for some other input/output reason, including 095 * {@link java.io.FileNotFoundException} if no file with the given <code>name</code> 096 * can be found, or {@link javax.imageio.IIOException} if an error was thrown by the 097 * underlying image library. 098 */ 099 public GridCoverage read( GeneralParameterValueIm[] parameters ) 100 throws InvalidParameterNameException, InvalidParameterValueException, 101 ParameterNotFoundException, IOException { 102 return null; 103 } 104 105 /** 106 * Allows any resources held by this object to be released. The result of calling any other 107 * method subsequent to a call to this method is undefined. It is important for applications to 108 * call this method when they know they will no longer be using this 109 * <code>GridCoverageReader</code>. Otherwise, the reader may continue to hold on to 110 * resources indefinitely. 111 * 112 * @throws IOException 113 * if an error occured while disposing resources (for example while closing a file). 114 */ 115 public void dispose() 116 throws IOException { 117 if ( source instanceof InputStream ) { 118 ( (InputStream) source ).close(); 119 } 120 } 121 122 }