public Collection<String> files(boolean includeSegmentsFile) throws IOException {
  HashSet<String> files=new HashSet<>();
  if (includeSegmentsFile) {
    final String segmentFileName=getSegmentsFileName();
    if (segmentFileName != null) {
      files.add(segmentFileName);
    }
  }
  final int size=size();
  for (int i=0; i < size; i++) {
    final SegmentCommitInfo info=info(i);
    files.addAll(info.files());
  }
  return files;
}

public Collection < String > files ( boolean includeSegmentsFile ) throws IOException { HashSet < String > files = new HashSet < > ( ) ; if ( includeSegmentsFile ) { final String segmentFileName = getSegmentsFileName ( ) ; if ( segmentFileName != null ) { files . add ( segmentFileName ) ; } } final int size = size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { final SegmentCommitInfo info = info ( i ) ; files . addAll ( info . files ( ) ) ; } return files ; }
returns all file names referenced by segmentinfo . the returned collection is recomputed on each invocation .
