com.vividsolutions.jump.io.datasource
Class DelegatingCompressedFileHandler

java.lang.Object
  extended by com.vividsolutions.jump.io.datasource.DelegatingCompressedFileHandler
All Implemented Interfaces:
JUMPReader

public class DelegatingCompressedFileHandler
extends java.lang.Object
implements JUMPReader

If the file is a .zip or .gz file, mangles the DriverProperties into the format expected by many of the first JUMPReaders, which take responsibility for doing the decompression. Really, JUMPReaders should not have to be responsible for decompression -- they should be wrapped by a CompressedFileHandler (not yet written) which would decompress the data before handing it to the JUMPReader. Anyway, developers should now be writing DataSources instead of JUMPReaders.


Constructor Summary
DelegatingCompressedFileHandler(JUMPReader reader, java.util.Collection endings)
          Constructs a DelegatingCompressedFileHandler that wraps a JUMPReader.
 
Method Summary
 FeatureCollection read(DriverProperties dp)
          Read the specified file using the filename given by the "File" property and any other parameters.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingCompressedFileHandler

public DelegatingCompressedFileHandler(JUMPReader reader,
                                       java.util.Collection endings)
Constructs a DelegatingCompressedFileHandler that wraps a JUMPReader.

Parameters:
endings - strings found at the ends of filenames, used to identify the file to extract from a .zip; does not apply to .gz files
Method Detail

read

public FeatureCollection read(DriverProperties dp)
                       throws java.lang.Exception
Description copied from interface: JUMPReader
Read the specified file using the filename given by the "File" property and any other parameters.

Specified by:
read in interface JUMPReader
Parameters:
dp - only the "File" property is necessary; if it is a .zip or .gz, the required "CompressedFile" property will be determined automatically
Throws:
java.lang.Exception