@Override public void activate() { super.activate(); importResources(new File(pathToWatch)); scheduler = Executors.newSingleThreadScheduledExecutor(); scheduler.scheduleWithFixedDelay(this::checkFiles, INITIAL_DELAY, RECHECK_INTERVAL, TimeUnit.SECONDS); }
@Override @Activate public void activate() { super.activate(); configDispatcher.processConfigFile(getSourcePath().toFile()); }
@Activate public void activate(ComponentContext ctx) { Dictionary<String, Object> config = ctx.getProperties(); Enumeration<String> keys = config.keys(); while (keys.hasMoreElements()) { String foldername = keys.nextElement(); if (!StringUtils.isAlphanumeric(foldername)) { // we allow only simple alphanumeric names for model folders - everything else might be other service // properties continue; } String[] fileExts = ((String) config.get(foldername)).split(","); File folder = getFile(foldername); if (folder.exists() && folder.isDirectory()) { folderFileExtMap.put(foldername, fileExts); } else { logger.warn("Directory '{}' does not exist in '{}'. Please check your configuration settings!", foldername, ConfigConstants.getConfigFolder()); } } addModelsToRepo(); super.activate(); }
public void activate(ComponentContext ctx) { Dictionary<String, Object> config = ctx.getProperties(); Enumeration<String> keys = config.keys(); while (keys.hasMoreElements()) { String foldername = keys.nextElement(); if (!StringUtils.isAlphanumeric(foldername)) { // we allow only simple alphanumeric names for model folders - everything else might be other service // properties continue; } String[] fileExts = ((String) config.get(foldername)).split(","); File folder = getFile(foldername); if (folder.exists() && folder.isDirectory()) { folderFileExtMap.put(foldername, fileExts); } else { logger.warn("Directory '{}' does not exist in '{}'. Please check your configuration settings!", foldername, ConfigConstants.getConfigFolder()); } } addModelsToRepo(); super.activate(); }