import javax.jcr.Session;
import javax.xml.namespace.NamespaceContext;
+import org.argeo.api.acr.Content;
import org.argeo.api.acr.spi.ContentProvider;
import org.argeo.api.acr.spi.ProvidedContent;
import org.argeo.api.acr.spi.ProvidedSession;
}
@Override
- public ProvidedContent get(ProvidedSession contentSession, String mountPath, String relativePath) {
+ public ProvidedContent get(ProvidedSession contentSession, String relativePath) {
String jcrWorkspace = ContentUtils.getParentPath(mountPath)[1];
String jcrPath = "/" + relativePath;
return new JcrContent(contentSession, this, jcrWorkspace, jcrPath);
}
+ @Override
+ public boolean exists(ProvidedSession contentSession, String relativePath) {
+ String jcrWorkspace = ContentUtils.getParentPath(mountPath)[1];
+ String jcrPath = "/" + relativePath;
+ return new JcrContent(contentSession, this, jcrWorkspace, jcrPath).exists();
+ }
+
public Session getJcrSession(ProvidedSession contentSession, String jcrWorkspace) {
JcrSessionAdapter sessionAdapter = sessionAdapters.get(contentSession);
if (sessionAdapter == null) {
return jcrSession;
}
+ public Session getJcrSession(Content content, String jcrWorkspace) {
+ return getJcrSession(((ProvidedContent) content).getSession(), jcrWorkspace);
+ }
+
@Override
public String getMountPath() {
return mountPath;