IndexFileNames
This class contains useful constants representing filenames and extensions used by lucene, as well as convenience methods for querying whether a file name matches an extension (.matchesExtension), as well as generating file names from a segment name, generation and extension ( .fileNameFromGeneration, .segmentFileName).
NOTE: extensions used by codecs are not listed here. You must interact with the [ ] directly.
Properties
Functions
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
NOTE: .ext is not an empty string.
Return the extension (anything after the first '.'), or null if there is no '.' in the file name.
Returns true if the given filename ends with the given extension. One should provide a pure extension, without '.'.
Returns the generation from this file name, or 0 if there is no generation.
Parses the segment name out of the given file name.
Returns a file name that includes the given segment name, your own custom name and extension. The format of the filename is:
Removes the extension (anything after the first '.'), otherwise returns the original filename.
Strips the segment name out of the given file name. If you used .segmentFileName or .fileNameFromGeneration to create your files, then this method simply removes whatever comes before the first '.', or the second '_' (excluding both).