org.basex.build.fs.parser
Class TXTParser

java.lang.Object
  extended by org.basex.build.fs.parser.AbstractParser
      extended by org.basex.build.fs.parser.TXTParser

public final class TXTParser
extends AbstractParser

Text parser that tries to extract textual content from files.

Author:
Workgroup DBIS, University of Konstanz 2005-09, ISC License, Bastian Lemke

Constructor Summary
TXTParser()
          Standard constructor.
 
Method Summary
 boolean check(BufferedFileChannel bfc)
           Checks if there is a File in correct format and can be read by the parser.
 void readContent(BufferedFileChannel bfc, NewFSParser parser)
           Reads the textual content from a FileChannel and fires events.
 
Methods inherited from class org.basex.build.fs.parser.AbstractParser
readMeta, readMetaAndContent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TXTParser

public TXTParser()
Standard constructor.

Method Detail

check

public boolean check(BufferedFileChannel bfc)

Checks if there is a File in correct format and can be read by the parser. Checks e.g. header bytes.

Specified by:
check in class AbstractParser
Parameters:
bfc - the BufferedFileChannel to read from.
Returns:
true if the file is supported.

readContent

public void readContent(BufferedFileChannel bfc,
                        NewFSParser parser)
                 throws java.io.IOException

Reads the textual content from a FileChannel and fires events.

Specified by:
readContent in class AbstractParser
Parameters:
bfc - the BufferedFileChannel to read from.
parser - the NewFSParser instance to write the content to.
Throws:
java.io.IOException - if any error occurs while reading from the file.