bw.write(" <files count='" + dir.listAll().length + "'>\n");
String[] files = dir.listAll();
Arrays.sort(files);
for (String file : files) {
bw.write(" <file name='" + file +
"' size='" + dir.fileLength(file) +
"' func='" + IndexGate.getFileFunction(file) + "'/>\n");
}
bw.write(" </files>\n");
List<IndexCommit> commits = DirectoryReader.listCommits(dir);
bw.write(" <commits count='" + commits.size() + "'>\n");