code: func ExtractFileEntries(tarBytes []byte, databaseType string) (map[string][]*TarFileEntry, error) {
  
  	indexArtifacts := map[string][]*TarFileEntry{}
  	tarReader := tar.NewReader(bytes.NewReader(tarBytes))
  	for {
  		hdr, err := tarReader.Next()
  		if err == io.EOF {
  			// end of tar archive
  			break
  		}
  		if err != nil {
  			return nil, err
  		}
  		//split the directory from the full name
  		dir, _ := filepath.Split(hdr.Name)
  		//remove the ending slash
  		if strings.HasPrefix(hdr.Name, "META-INF/statedb/"+databaseType) {
  			fileContent, err := ioutil.ReadAll(tarReader)
  			if err != nil {
  				return nil, err
  			}
  			indexArtifacts[filepath.Clean(dir)] = append(indexArtifacts[filepath.Clean(dir)], &TarFileEntry{FileHeader: hdr, FileContent: fileContent})
  		}
  	}
  
  	return indexArtifacts, nil
  }
docs: // ExtractFileEntries extract file entries from the given `tarBytes`. A file entry is included in the
  // returned results only if it is located in a directory under the indicated databaseType directory
  // Example for chaincode indexes:
  // "META-INF/statedb/couchdb/indexes/indexColorSortName.json"
  // Example for collection scoped indexes:
  // "META-INF/statedb/couchdb/collections/collectionMarbles/indexes/indexCollMarbles.json"
  // An empty string will have the effect of returning all statedb metadata.  This is useful in validating an
  // archive in the future with multiple database types