if (level == SyncLevel.TOP) { long time = dir.lastModified(); SyncRequest.ModTime mt = new SyncRequest.ModTime(".", time); sr.files.add(mt); return; SyncRequest.ModTime mt = new SyncRequest.ModTime(name, time); sr.files.add(mt); if (logger.isLoggable(Level.FINER))
/** * Synchronize all the applications in the applications directory. * We use the mod time of the application directory to decide if * the application has changed. If it has changed, we also send * any of the generated content. */ private void synchronizeApplications(Payload.Outbound payload, Server server, SyncRequest sr) throws URISyntaxException { if (logger.isLoggable(Level.FINER)) logger.finer("ServerSynchronizer: " + "synchronize application instance " + sr.instance); Map<String, Application> apps = getApps(server); File appsDir = env.getApplicationRepositoryPath(); for (ModTime mt : sr.files) { if (apps.containsKey(mt.name)) { syncApp(apps.get(mt.name), appsDir, mt, payload); // if client has app, remove it from set apps.remove(mt.name); } else removeApp(apps.get(mt.name), appsDir, mt, payload); } // now do all the remaining apps the client doesn't have for (Map.Entry<String, Application> e : apps.entrySet()) syncApp(e.getValue(), appsDir, new ModTime(e.getKey(), 0), payload); }
/** * Synchronize all the applications in the applications directory. * We use the mod time of the application directory to decide if * the application has changed. If it has changed, we also send * any of the generated content. */ private void synchronizeApplications(Payload.Outbound payload, Server server, SyncRequest sr) throws URISyntaxException { logger.finer("ServerSynchronizer: synchronize application instance " + sr.instance); Map<String, Application> apps = getApps(server); File appsDir = env.getApplicationRepositoryPath(); for (ModTime mt : sr.files) { if (apps.containsKey(mt.name)) { syncApp(apps.get(mt.name), appsDir, mt, payload); // if client has app, remove it from set apps.remove(mt.name); } else removeApp(apps.get(mt.name), appsDir, mt, payload); } // now do all the remaining apps the client doesn't have for (Map.Entry<String, Application> e : apps.entrySet()) syncApp(e.getValue(), appsDir, new ModTime(e.getKey(), 0), payload); }
private void synchronizeDirectory(Payload.Outbound payload, Server server, SyncRequest sr, File dir, List<String> fileSet) throws URISyntaxException { for (ModTime mt : sr.files) { if (fileSet.contains(mt.name)) { // if client has file, remove it from set fileSet.remove(mt.name); syncFile(domainRootUri, dir, mt, payload); } else removeFile(domainRootUri, dir, mt, payload); } // now do all the remaining files the client doesn't have for (String name : fileSet) syncFile(domainRootUri, dir, new ModTime(name, 0), payload); }
private void synchronizeDirectory(Payload.Outbound payload, Server server, SyncRequest sr, File dir, List<String> fileSet) throws URISyntaxException { for (ModTime mt : sr.files) { if (fileSet.contains(mt.name)) { // if client has file, remove it from set fileSet.remove(mt.name); syncFile(domainRootUri, dir, mt, payload); } else removeFile(domainRootUri, dir, mt, payload); } // now do all the remaining files the client doesn't have for (String name : fileSet) syncFile(domainRootUri, dir, new ModTime(name, 0), payload); }