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.GZIPInputSource

public final class GZIPInputSource
extends EXistInputSource

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
 
Method Summary
 void close()
           
 InputStream getByteStream()
          This method was re-implemented to open a new GZIPInputStream each time it is called.
 long getByteStreamLength()
           
 String getSymbolicPath()
           
 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
 void setSystemId(String systemId)
          This method now does nothing, so collateral effects from superclass with this one are avoided
 
Methods inherited from class org.xml.sax.InputSource
getCharacterStream, getEncoding, getPublicId, getSystemId, setEncoding, setPublicId
 
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

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 InputSource
Returns:
If the file was set, and it could be opened, and it was a correct gzip file, a GZIPInputStream object. null, otherwise.

close

public void close()
Specified by:
close in class EXistInputSource

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 InputSource

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 InputSource

setSystemId

public void setSystemId(String systemId)
This method now does nothing, so collateral effects from superclass with this one are avoided

Overrides:
setSystemId in class InputSource

getByteStreamLength

public long getByteStreamLength()
Specified by:
getByteStreamLength in class EXistInputSource

getSymbolicPath

public String getSymbolicPath()
Specified by:
getSymbolicPath in class EXistInputSource


Copyright (C) Wolfgang Meier. All rights reserved.