JcrLabeledResource.java
1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* 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;
}
}