SymlinkResource.java
1.16 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.sling.api.resource.Resource
* org.apache.sling.api.resource.ResourceWrapper
* org.apache.sling.api.resource.ValueMap
*/
package com.adobe.granite.confmgr.impl;
import com.adobe.granite.confmgr.impl.SymlinkValueMap;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceWrapper;
import org.apache.sling.api.resource.ValueMap;
class SymlinkResource
extends ResourceWrapper {
private final Resource source;
public SymlinkResource(Resource source, Resource target) {
super(target);
this.source = source;
}
public ValueMap getValueMap() {
if (this.getChild("jcr:content") == null) {
return new SymlinkValueMap(this.source, super.getResource());
}
return super.getValueMap();
}
public Resource getChild(String relPath) {
Resource child = super.getChild(relPath);
if (child == null) {
return null;
}
if ("jcr:content".equals(relPath)) {
return new SymlinkResource(this.source, child);
}
return child;
}
}