private String mountPath;
+ // cache
+ private String jcrWorkspace;
+
private Map<ProvidedSession, JcrSessionAdapter> sessionAdapters = Collections.synchronizedMap(new HashMap<>());
public void start(Map<String, String> properties) {
if ("/".equals(mountPath))
throw new IllegalArgumentException("JCR content provider cannot be root /");
Objects.requireNonNull(mountPath);
- adminSession = CmsJcrUtils.openDataAdminSession(jcrRepository, null);
+ jcrWorkspace = ContentUtils.getParentPath(mountPath)[1];
+ adminSession = CmsJcrUtils.openDataAdminSession(jcrRepository, jcrWorkspace);
}
public void stop() {
@Override
public ProvidedContent get(ProvidedSession contentSession, String relativePath) {
- String jcrWorkspace = ContentUtils.getParentPath(mountPath)[1];
String jcrPath = "/" + relativePath;
return new JcrContent(contentSession, this, jcrWorkspace, jcrPath);
}