FileDocCategorySizeDatePackage
IndexFileNames.javaAPI DocApache Lucene 2.2.03591Sat Jun 16 22:20:36 BST 2007org.apache.lucene.index

IndexFileNames

public final class IndexFileNames extends Object
Useful constants representing filenames and extensions used by lucene
author
Bernhard Messer
version
$rcs = ' $Id: Exp $ ' ;

Fields Summary
static final String
SEGMENTS
Name of the index segment file
static final String
SEGMENTS_GEN
Name of the generation reference file name
static final String
DELETABLE
Name of the index deletable file (only used in pre-lockless indices)
static final String
NORMS_EXTENSION
Extension of norms file
static final String
COMPOUND_FILE_EXTENSION
Extension of compound file
static final String
DELETES_EXTENSION
Extension of deletes
static final String
PLAIN_NORMS_EXTENSION
Extension of plain norms
static final String
SEPARATE_NORMS_EXTENSION
Extension of separate norms
static final String[]
INDEX_EXTENSIONS
This array contains all filename extensions used by Lucene's index files, with two exceptions, namely the extension made up from .f + a number and from .s + a number. Also note that Lucene's segments_N files do not have any filename extension.
static final String[]
INDEX_EXTENSIONS_IN_COMPOUND_FILE
File extensions that are added to a compound file (same as above, minus "del", "gen", "cfs").
static final String[]
COMPOUND_EXTENSIONS
File extensions of old-style index files
static final String[]
VECTOR_EXTENSIONS
File extensions for term vector support
Constructors Summary
Methods Summary
static final java.lang.StringfileNameFromGeneration(java.lang.String base, java.lang.String extension, long gen)
Computes the full file name from base, extension and generation. If the generation is -1, the file name is null. If it's 0, the file name is . If it's > 0, the file name is _.

param
base -- main part of the file name
param
extension -- extension of the filename (including .)
param
gen -- generation


                                                                  
           
    if (gen == SegmentInfo.NO) {
      return null;
    } else if (gen == SegmentInfo.WITHOUT_GEN) {
      return base + extension;
    } else {
      return base + "_" + Long.toString(gen, Character.MAX_RADIX) + extension;
    }