Package net.augeas

Examples of net.augeas.Augeas.match()


        Augeas augeas = null;
        try {
            augeas = serverComponent.getAugeas();

            if (augeas!=null) {
                List<String> matches = augeas.match("/files/etc/samba/smb.conf/target[. != 'global']");
                for (String match : matches) {
                    String name = augeas.get(match);
                    Configuration pluginConfig = discoveryContext.getDefaultPluginConfiguration();
                    pluginConfig.put(new PropertySimple("targetName", name));
                    DiscoveredResourceDetails detail = new DiscoveredResourceDetails(discoveryContext.getResourceType(),
View Full Code Here


        String targetName = pluginConfig.getSimple(TARGET_NAME_PROP).getStringValue();
        String targetPath = "/files/etc/samba/smb.conf/target[.='" + targetName + "']";
        AugeasNode targetNode = new AugeasNode(targetPath);
        Augeas augeas = getAugeas();

        List<String> matches = augeas.match(targetNode.getPath());
        return matches.get(0);
    }

    public void stop() {
        super.stop();
View Full Code Here

        // First find all child nodes with the same 'spec' value as the PropertyMap.
        Augeas augeas = getAugeas();

        String userName = propMap.getSimple("user").getStringValue();
        String specFilter = parentNode.getPath() + "/spec";
        List<String> userPaths = augeas.match(String.format(specFilter + "/user[.='%s']", userName));
        if (userPaths == null || userPaths.isEmpty()) {
            return null;
        }
        AugeasNode node = new AugeasNode(userPaths.get(0));
        return node.getParent();
View Full Code Here

        }

        String sourcesTreeNode = augeasTreeNodeProperty.getStringValue();

        // Request data from augeas
        List<String> matches = augeas.match(sourcesTreeNode);
        if (matches.size() == 0) {
            throw new Exception("Unable to load apt sources data from augeas");
        }

        // Parse out the properties
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.