JcrLabeledResource.java 1.54 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  javax.jcr.Node
 *  javax.jcr.Property
 *  javax.jcr.RepositoryException
 */
package com.day.cq.commons;

import com.day.cq.commons.LabeledResource;
import javax.jcr.Node;
import javax.jcr.Property;
import javax.jcr.RepositoryException;

public class JcrLabeledResource
implements LabeledResource {
    private final String path;
    private final String name;
    private final String title;
    private final String description;

    public JcrLabeledResource(Node node) throws RepositoryException {
        Node contentNode;
        this.path = node.getPath();
        this.name = node.getName();
        Node node2 = contentNode = node.hasNode("jcr:content") ? node.getNode("jcr:content") : null;
        this.title = node.hasProperty("jcr:title") ? node.getProperty("jcr:title").getString() : (contentNode != null && contentNode.hasProperty("jcr:title") ? contentNode.getProperty("jcr:title").getString() : null);
        this.description = node.hasProperty("jcr:description") ? node.getProperty("jcr:description").getString() : (contentNode != null && contentNode.hasProperty("jcr:description") ? contentNode.getProperty("jcr:description").getString() : null);
    }

    @Override
    public String getPath() {
        return this.path;
    }

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public String getTitle() {
        return this.title;
    }

    @Override
    public String getDescription() {
        return this.description;
    }
}