this.executor = executor; this.scanner = scanner; this.resourceManager = new ResourceManager(cmdFS, confFS); this.propertyManager = new PropertyManager();
/** * List the resources id for a specific resource kind. * * @param kind the resource kind * @return the resource ids */ public Iterable<String> listResources(ResourceKind kind) { return resourceManager.listResourceId(kind); }
/** * Load a resource from the context. * * @param resourceId the resource id * @param resourceKind the resource kind * @return the resource or null if it cannot be found */ public Iterable<Resource> loadResources(String resourceId, ResourceKind resourceKind) { return resourceManager.loadResource(resourceId, resourceKind); }
/** * Refresh the fs system view. This is normally triggered by the periodic job but it can be manually * invoked to trigger explicit refreshes. */ public void refresh() { resourceManager.refresh(); }
private void copyConf(org.crsh.vfs.File src, File dst) throws IOException { if (!src.hasChildren()) { if (!dst.exists()) { Resource resource = ResourceManager.loadConf(src); if (resource != null) { log.info("Copied resource " + src.getPath().getValue() + " to " + dst.getCanonicalPath()); Utils.copy(new ByteArrayInputStream(resource.getContent()), new FileOutputStream(dst)); } } } }
/** * Refresh the fs system view. This is normally triggered by the periodic job but it can be manually * invoked to trigger explicit refreshes. */ public void refresh() { resourceManager.refresh(); }
File file = confFS.get(Path.get(path)); if (file != null) { return Collections.singleton(loadConf(file));
/** * Load a resource from the context. * * @param resourceId the resource id * @param resourceKind the resource kind * @return the resource or null if it cannot be found */ public Resource loadResource(String resourceId, ResourceKind resourceKind) { return Utils.first(resourceManager.loadResource(resourceId, resourceKind)); }
/** * List the resources id for a specific resource kind. * * @param kind the resource kind * @return the resource ids */ public Iterable<String> listResources(ResourceKind kind) { return resourceManager.listResourceId(kind); }
/** * Refresh the fs system view. This is normally triggered by the periodic job but it can be manually * invoked to trigger explicit refreshes. */ public void refresh() { resourceManager.refresh(); }
this.executor = executor; this.scanner = scanner; this.resourceManager = new ResourceManager(cmdFS, confFS); this.propertyManager = new PropertyManager();
private void copyConf(org.crsh.vfs.File src, File dst) throws IOException { if (!src.hasChildren()) { if (!dst.exists()) { Resource resource = ResourceManager.loadConf(src); if (resource != null) { log.info("Copied resource " + src.getPath().getValue() + " to " + dst.getCanonicalPath()); Utils.copy(new ByteArrayInputStream(resource.getContent()), new FileOutputStream(dst)); } } } }
/** * Load a resource from the context. * * @param resourceId the resource id * @param resourceKind the resource kind * @return the resource or null if it cannot be found */ public Iterable<Resource> loadResources(String resourceId, ResourceKind resourceKind) { return resourceManager.loadResource(resourceId, resourceKind); }
/** * List the resources id for a specific resource kind. * * @param kind the resource kind * @return the resource ids */ public List<String> listResourceId(ResourceKind kind) { return resourceManager.listResourceId(kind); }
/** * Refresh the fs system view. This is normally triggered by the periodic job but it can be manually * invoked to trigger explicit refreshes. */ public void refresh() { resourceManager.refresh(); }
this.executor = executor; this.scanner = scanner; this.resourceManager = new ResourceManager(cmdFS, confFS); this.propertyManager = new PropertyManager();
private void copyConf(org.crsh.vfs.File src, File dst) throws IOException { if (!src.hasChildren()) { if (!dst.exists()) { Resource resource = ResourceManager.loadConf(src); if (resource != null) { log.info("Copied resource " + src.getPath().getValue() + " to " + dst.getCanonicalPath()); Utils.copy(new ByteArrayInputStream(resource.getContent()), new FileOutputStream(dst)); } } } }
/** * Load a resource from the context. * * @param resourceId the resource id * @param resourceKind the resource kind * @return the resource or null if it cannot be found */ public Resource loadResource(String resourceId, ResourceKind resourceKind) { return resourceManager.loadResource(resourceId, resourceKind); }
/** * List the resources id for a specific resource kind. * * @param kind the resource kind * @return the resource ids */ public Iterable<String> listResources(ResourceKind kind) { return resourceManager.listResourceId(kind); }
this.executor = executor; this.scanner = scanner; this.resourceManager = new ResourceManager(cmdFS, confFS); this.propertyManager = new PropertyManager();