org.exist.util
Class GZIPInputSource

java.lang.Object
  extended by org.xml.sax.InputSource
      extended by org.exist.util.EXistInputSource
          extended by org.exist.util.FileInputSource
              extended by org.exist.util.GZIPInputSource

public final class GZIPInputSource
extends FileInputSource

This class extends InputSource to be able to deal with GZIP compressed files. Its main feature is that each time getByteStream() is called, a new uncompressed stream is created from the compressed GZIP file. This is very useful for eXist, which works in two steps: validation and insertion.

Author:
José María Fernández (jmfg@users.sourceforge.net)

Constructor Summary
GZIPInputSource()
          Empty constructor
GZIPInputSource(File gzipFile)
          Constructor which calls FileInputSource.getFile()
 
Method Summary
 InputStream getByteStream()
          This method was re-implemented to open a new GZIPInputStream each time it is called.
 long getByteStreamLength()
           
 void setByteStream(InputStream is)
          This method now does nothing, so collateral effects from superclass with this one are avoided
 void setCharacterStream(Reader r)
          This method now does nothing, so collateral effects from superclass with this one are avoided
 
Methods inherited from class org.exist.util.FileInputSource
getFile, getSymbolicPath, setFile
 
Methods inherited from class org.xml.sax.InputSource
getCharacterStream, getEncoding, getPublicId, getSystemId, setEncoding, setPublicId, setSystemId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GZIPInputSource

public GZIPInputSource()
Empty constructor


GZIPInputSource

public GZIPInputSource(File gzipFile)
Constructor which calls FileInputSource.getFile()

Parameters:
gzipFile - The file passed to FileInputSource.getFile()
Method Detail

getByteStream

public InputStream getByteStream()
This method was re-implemented to open a new GZIPInputStream each time it is called.

Overrides:
getByteStream in class FileInputSource
Returns:
If the file was set, and it could be opened, and it was a correct gzip file, a GZIPInputStream object. null, otherwise.

setByteStream

public void setByteStream(InputStream is)
This method now does nothing, so collateral effects from superclass with this one are avoided

Overrides:
setByteStream in class FileInputSource

setCharacterStream

public void setCharacterStream(Reader r)
This method now does nothing, so collateral effects from superclass with this one are avoided

Overrides:
setCharacterStream in class FileInputSource

getByteStreamLength

public long getByteStreamLength()
Overrides:
getByteStreamLength in class FileInputSource


Copyright (C) Wolfgang Meier. All rights reserved.