import org.argeo.api.acr.spi.ProvidedSession;
import org.argeo.api.cms.CmsConstants;
import org.argeo.cms.acr.AbstractContent;
-import org.argeo.cms.acr.ContentUtils;
+import org.argeo.cms.acr.CmsContent;
import org.argeo.cms.util.AsyncPipedOutputStream;
import org.argeo.jcr.Jcr;
import org.argeo.jcr.JcrException;
this.jcrWorkspace = jcrWorkspace;
this.jcrPath = jcrPath;
- this.isMountBase = ContentUtils.SLASH_STRING.equals(jcrPath);
+ this.isMountBase = "/".equals(jcrPath);
}
/*
String name = Jcr.getName(getJcrNode());
if (name.equals("")) {// root
String mountPath = provider.getMountPath();
- name = ContentUtils.getParentPath(mountPath)[1];
+ name = CmsContent.getParentPath(mountPath)[1];
// name = Jcr.getWorkspaceName(getJcrNode());
}
return NamespaceUtils.parsePrefixedName(provider, name);
String mountPath = provider.getMountPath();
if (mountPath == null || mountPath.equals("/"))
return null;
- String[] parent = ContentUtils.getParentPath(mountPath);
+ String[] parent = CmsContent.getParentPath(mountPath);
return getSession().get(parent[0]);
}
// if (Jcr.isRoot(getJcrNode())) // root
@Override
public boolean isParentAccessible() {
- String jcrParentPath = ContentUtils.getParentPath(jcrPath)[0];
+ String jcrParentPath = CmsContent.getParentPath(jcrPath)[0];
if ("".equals(jcrParentPath)) // JCR root node
- jcrParentPath = ContentUtils.SLASH_STRING;
+ jcrParentPath = "/";
try {
return getJcrSession().hasPermission(jcrParentPath, Session.ACTION_READ);
} catch (RepositoryException e) {
import org.argeo.api.acr.spi.ProvidedContent;
import org.argeo.api.acr.spi.ProvidedSession;
import org.argeo.api.cms.CmsConstants;
-import org.argeo.cms.acr.ContentUtils;
+import org.argeo.cms.acr.CmsContent;
import org.argeo.cms.jcr.CmsJcrUtils;
import org.argeo.jcr.JcrException;
import org.argeo.jcr.JcrUtils;
if ("/".equals(mountPath))
throw new IllegalArgumentException("JCR content provider cannot be root /");
Objects.requireNonNull(mountPath);
- jcrWorkspace = ContentUtils.getParentPath(mountPath)[1];
+ jcrWorkspace = CmsContent.getParentPath(mountPath)[1];
adminSession = CmsJcrUtils.openDataAdminSession(jcrRepository, jcrWorkspace);
}
@Override
public boolean exists(ProvidedSession contentSession, String relativePath) {
- String jcrPath = ContentUtils.SLASH + relativePath;
+ String jcrPath = '/' + relativePath;
return new JcrContent(contentSession, this, jcrWorkspace, jcrPath).exists();
}
* workspace of this provider.
*/
private String toJcrPath(String relativePath) {
- return ContentUtils.SLASH + relativePath;
+ return '/' + relativePath;
}
/*