}
// using MapBuilder and not ImmutableMap.Builder as it seems like File#listFiles might return duplicate files!
MapBuilder<String, BlobMetaData> builder = MapBuilder.newMapBuilder();
for (File file : files) {
if (file.isFile()) {
builder.put(file.getName(), new PlainBlobMetaData(file.getName(), file.length()));
}
}
return builder.immutableMap();
}