for (Map.Entry<File, DatabaseRemoteFile> remoteDatabaseFileEntry : remoteDatabases.entrySet()) {
MemoryDatabase remoteDatabase = new MemoryDatabase(); // Database cannot be reused, since these might be different clients
File remoteDatabaseFileInCache = remoteDatabaseFileEntry.getKey();
DatabaseRemoteFile remoteDatabaseFile = remoteDatabaseFileEntry.getValue();
databaseSerializer.load(remoteDatabase, remoteDatabaseFileInCache, null, null, DatabaseReadType.HEADER_ONLY, null, null); // only load headers!
List<DatabaseVersion> remoteDatabaseVersions = remoteDatabase.getDatabaseVersions();
// Populate branches
DatabaseBranch remoteClientBranch = unknownRemoteBranches.getBranch(remoteDatabaseFile.getClientName(), true);
for (DatabaseVersion remoteDatabaseVersion : remoteDatabaseVersions) {
DatabaseVersionHeader header = remoteDatabaseVersion.getHeader();
remoteClientBranch.add(header);
}