de.spieleck.app.jacson.source
Class LineChunkSource
java.lang.Object
de.spieleck.app.jacson.PluginBase
de.spieleck.app.jacson.source.ChunkSourceBase
de.spieleck.app.jacson.source.LineChunkSource
- All Implemented Interfaces:
- JacsonChunkSource, JacsonReporting, JacsonStately
- Direct Known Subclasses:
- GenericLineChunkSource, OCRSource
- public class LineChunkSource
- extends ChunkSourceBase
Simplest possible Source:
Reads a file and generates a chunk for every single line read.
The only "major" feature: gzipped files are automagically unpacked
while reading. This has proved to be quite useful for weblos, since
those can be large and compress well..
- Author:
- fsn
Field Summary |
protected int |
chunks
|
protected java.lang.String |
fileName
|
protected java.io.BufferedReader |
in
|
Method Summary |
java.lang.String |
message()
|
java.lang.String |
nextChunk()
Deliver a sequence of chunks (that is Strings). |
void |
setReader(java.io.Reader ir)
|
void |
setStream(java.io.InputStream is)
|
void |
setStream(java.io.InputStream is,
boolean ungzip)
|
void |
summary()
Do nothing default implementation |
static java.io.InputStream |
unwrapGZIP(java.io.InputStream is)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fileName
protected java.lang.String fileName
in
protected java.io.BufferedReader in
chunks
protected int chunks
LineChunkSource
public LineChunkSource()
LineChunkSource
public LineChunkSource(java.lang.String fileName,
boolean ungzip)
throws JacsonException
LineChunkSource
public LineChunkSource(java.io.InputStream is,
boolean ungzip)
throws JacsonException
setStream
public void setStream(java.io.InputStream is)
throws JacsonException
- Throws:
JacsonException
setStream
public void setStream(java.io.InputStream is,
boolean ungzip)
throws JacsonException
- Throws:
JacsonException
setReader
public void setReader(java.io.Reader ir)
nextChunk
public java.lang.String nextChunk()
throws JacsonException
- Description copied from interface:
JacsonChunkSource
- Deliver a sequence of chunks (that is Strings).
- Returns:
- The next String if available, null if sequence is finished.
- Throws:
JacsonException
message
public java.lang.String message()
summary
public void summary()
- Description copied from class:
PluginBase
- Do nothing default implementation
- Specified by:
summary
in interface JacsonReporting
- Overrides:
summary
in class PluginBase
unwrapGZIP
public static java.io.InputStream unwrapGZIP(java.io.InputStream is)
throws java.io.IOException
- Throws:
java.io.IOException
Copyleft 2002 spieleck.de.