]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - api/acr/spi/ProvidedContent.java
1 package org
.argeo
.api
.acr
.spi
;
3 import org
.argeo
.api
.acr
.Content
;
5 /** A {@link Content} implementation. */
6 public interface ProvidedContent
extends Content
{
7 final static String ROOT_PATH
= "/";
9 ProvidedSession
getSession();
11 ContentProvider
getProvider();
16 * Whether this is the root node of the related repository. Default checks
17 * whether <code>{@link #getDepth()} == 0</code>, but it can be optimised by
20 default boolean isRoot() {
21 return getDepth() == 0;
25 * An opaque ID which is guaranteed to uniquely identify this content within the
26 * session return by {@link #getSession()}. Typically used for UI.
28 String
getSessionLocalId();
30 default ProvidedContent
getMountPoint(String relativePath
) {
31 throw new UnsupportedOperationException("This content doe not support mount");
34 default ProvidedContent
getContent(String path
) {
36 if (path
.startsWith(ROOT_PATH
)) {// absolute
37 fileNode
= getSession().get(path
);
39 String absolutePath
= getPath() + '/' + path
;
40 fileNode
= getSession().get(absolutePath
);
42 return (ProvidedContent
) fileNode
;
48 /** Whether the session has the right to access the parent. */
49 default boolean isParentAccessible() {