Class RepoPath
- java.lang.Object
-
- org.apache.sling.feature.cpconverter.shared.RepoPath
-
- All Implemented Interfaces:
Comparable<RepoPath>
public class RepoPath extends Object implements Comparable<RepoPath>
A Repo Path represents a path in the repository, for example when used in a repoinit section.- See Also:
- Repoinit Grammar
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(@NotNull RepoPath o)booleanequals(Object obj)@Nullable RepoPathgetParent()Get the parent path of the current path.@NotNull List<String>getSegments()inthashCode()booleanisRepositoryPath()booleanstartsWith(@Nullable RepoPath otherPath)Check is this path starts with the other path.StringtoString()
-
-
-
Constructor Detail
-
RepoPath
public RepoPath(@NotNull @NotNull String path)Construct a Repo Path from a string. The string should separate the path segments with forward slashes, e.g./my/repo/path.- Parameters:
path- The string representation of the path. If the initial leading forward slash is missing it will be assumed to be there.
-
-
Method Detail
-
compareTo
public int compareTo(@NotNull @NotNull RepoPath o)- Specified by:
compareToin interfaceComparable<RepoPath>
-
getParent
@Nullable public @Nullable RepoPath getParent()
Get the parent path of the current path.- Returns:
- The parent path, or
nullif we are at the root and there is no further parent.
-
startsWith
public boolean startsWith(@Nullable @Nullable RepoPath otherPath)Check is this path starts with the other path.- Parameters:
otherPath- The other path to check against.- Returns:
- If it starts with the other path or not.
-
isRepositoryPath
public boolean isRepositoryPath()
-
-