| java.lang.Object org.apache.lucene.index.CompoundFileWriter
CompoundFileWriter | final class CompoundFileWriter (Code) | | Combines multiple files into a single compound file.
The file format:
- VInt fileCount
- {Directory}
fileCount entries with the following structure:
- long dataOffset
- String fileName
- {File Data}
fileCount entries with the raw data of the corresponding file
The fileCount integer indicates how many files are contained in this compound
file. The {directory} that follows has that many entries. Each directory entry
contains a long pointer to the start of this file's data section, and a String
with that file's name.
version: $Id: CompoundFileWriter.java 606441 2007-12-22 10:06:28Z mikemccand $ |
Method Summary | |
public void | addFile(String file) Add a source stream. | public void | close() Merge files with the extensions added up to now.
All files with these extensions are combined sequentially into the
compound stream. | public Directory | getDirectory() Returns the directory of the compound file. | public String | getName() Returns the name of the compound file. |
CompoundFileWriter | public CompoundFileWriter(Directory dir, String name)(Code) | | Create the compound stream in the specified file. The file name is the
entire name (no extensions are added).
throws: NullPointerException - if dir or name is null |
close | public void close() throws IOException(Code) | | Merge files with the extensions added up to now.
All files with these extensions are combined sequentially into the
compound stream. After successful merge, the source files
are deleted.
throws: IllegalStateException - if close() had been called before orif no file has been added to this object |
getDirectory | public Directory getDirectory()(Code) | | Returns the directory of the compound file.
|
getName | public String getName()(Code) | | Returns the name of the compound file.
|
|
|