Node getConfTree()

in src/main/java/org/apache/sling/pipes/internal/WritePipe.java [65:83]


    Node getConfTree() {
        if (confTree == null) {
            if (getConfiguration() == null) {
                String pathCandidate = getExpr();
                if (StringUtils.isBlank(pathCandidate)) {
                    throw new IllegalArgumentException("write pipe is mis-configured: it should have a configuration node, or an expression");
                }
                Resource candidate = resolver.getResource(pathCandidate);
                if (candidate != null) {
                    return candidate.adaptTo(Node.class);
                } else {
                    throw new IllegalArgumentException("write pipe expression" + pathCandidate + " does not refer to any existing resource");
                }
            } else {
                confTree = getConfiguration().adaptTo(Node.class);
            }
        }
        return confTree;
    }