FileDocCategorySizeDatePackage
IndexFileNames.javaAPI DocApache Lucene 2.1.02938Wed Feb 14 10:46:40 GMT 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[]
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[]
COMPOUND_EXTENSIONS
File extensions of old-style index files
static final String[]
VECTOR_EXTENSIONS
File extensions for term vector support
Constructors Summary
Methods Summary
public 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 == -1) {
      return null;
    } else if (gen == 0) {
      return base + extension;
    } else {
      return base + "_" + Long.toString(gen, Character.MAX_RADIX) + extension;
    }