ResourceReaderImpl.java
1.55 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.repository.bindings.ResourceRepository
* com.adobe.repository.infomodel.bean.Resource
* com.adobe.repository.infomodel.bean.ResourceContent
* org.apache.felix.scr.annotations.Component
* org.apache.felix.scr.annotations.Reference
* org.apache.felix.scr.annotations.Service
*/
package com.adobe.aemds.connector.repository.impl;
import com.adobe.aemds.connector.repository.Resource;
import com.adobe.aemds.connector.repository.ResourceReader;
import com.adobe.aemds.connector.repository.impl.ResourceImpl;
import com.adobe.repository.bindings.ResourceRepository;
import com.adobe.repository.infomodel.bean.ResourceContent;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
@Service(value={ResourceReader.class})
@Component(immediate=1)
public class ResourceReaderImpl
implements ResourceReader {
@Reference
ResourceRepository resourceRepository;
public Resource readResource(String resourcePath) throws Exception {
return new ResourceImpl(this.resourceRepository.readResource(resourcePath).getContent());
}
protected void bindResourceRepository(ResourceRepository resourceRepository) {
this.resourceRepository = resourceRepository;
}
protected void unbindResourceRepository(ResourceRepository resourceRepository) {
if (this.resourceRepository == resourceRepository) {
this.resourceRepository = null;
}
}
}