Interface Mount
- All Known Implementing Classes:
MountInfo
ContentRepositoryx that are possibly
stored in a separate physical persistent store.
In a default setup all paths belong to a default Mount.
-
Method Summary
Modifier and TypeMethodDescriptiongetName()Name of the mount.Returns fragment name which can be used to construct node name used for storing meta content belonging to path under thisMount.booleanChecks whether current mount is the default mount.booleanisDirectlyUnder(String path) Checks if this mount directly falls under given path.booleanChecks if given path belongs to thisMountbooleanChecks whether the mount is marked as read only.booleanisSupportFragment(String path) Checks if this mount supports mounting nodes containing the fragment (seegetPathFragmentName()) under the given path.booleanisSupportFragmentUnder(String path) Checks if any path supporting the fragments falls under the specified path.booleanChecks if this mount falls under given path.
-
Method Details
-
getName
String getName()Name of the mount. If this@Mountis the default mount, an empty string is returned -
isReadOnly
boolean isReadOnly()Checks whether the mount is marked as read only.- Returns:
- true if the mount is read only.
-
isDefault
boolean isDefault()Checks whether current mount is the default mount.The Default mount includes the root path and all other paths which are not part of any other mount.
- Returns:
- true if this mount represents the default mount
-
getPathFragmentName
String getPathFragmentName()Returns fragment name which can be used to construct node name used for storing meta content belonging to path under thisMount. Such a node name would be used by NodeStore to determine the storage for nodes under those paths.Fragment name is formatted as 'oak:mount-<mount name>'
For e.g. for mount name 'private' the fragment name would be
oak:mount-private. This can be then used to construct node name likeoak:mount-private-indexand then any derived content for path under this mount would be stored as child node under oak:mount-private-index like/fooIndex/oak:mount-private-index/foo. Such paths would then be stored in a separate store which would only be storing paths belonging to that mountIf this
Mountis the default mount, an empty string is returned- Returns:
- node name prefix which can be used
-
isSupportFragment
Checks if this mount supports mounting nodes containing the fragment (seegetPathFragmentName()) under the given path.- Parameters:
path- ancestor path- Returns:
- true if the path fragment mounts are supported in the given subtree
-
isSupportFragmentUnder
Checks if any path supporting the fragments falls under the specified path.- Parameters:
path- ancestor path- Returns:
- true if the path fragment mounts are supported under some descendants of the specified path
-
isMounted
Checks if given path belongs to thisMountA path belongs to a Mount in two scenarios:
- The path is below a fragment-supported path and the path contains a fragment name.
- The path of this mount is the most specific ancestor for the specified path.
The fragment check has a higher priority, and the presence of a fragment name in the path always decides the mount this path belongs to.
- Parameters:
path- path to check- Returns:
- true if path belong to this mount
- See Also:
-
isUnder
Checks if this mount falls under given path.For e.g. if a mount consist of '/etc/config'. Then if path is
- /etc - Then it returns true
- /etc/config - Then it returns false
- /lib - Then it returns false
- Parameters:
path- path to check- Returns:
- true if this Mount is rooted under given path
-
isDirectlyUnder
Checks if this mount directly falls under given path.For e.g. if a mount consist of '/etc/my/config'. Then if path is
- /etc - Then it returns false
- /etc/my - Then it returns true
- /etc/my/config- Then it returns false
- /lib - Then it returns false
- Parameters:
path- path to check- Returns:
- true if this Mount is rooted directly under given path
-