Package org.ec4j.core
Interface ResourcePath
- All Known Implementing Classes:
ResourcePath.ResourcePaths.ClassPathResourcePath,ResourcePath.ResourcePaths.PathResourcePath,ResourcePath.ResourcePaths.StringResourcePath
public interface ResourcePath
A directory path in filesystem like
Resource hierarchies. The implementations must override
Object.hashCode() and Object.equals(Object)-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA class that aggregates theResourcePathinterface and a few common implementations ofResourcePath. -
Method Summary
Modifier and TypeMethodDescriptiongetPath()booleanrelativize(Resource resource) Constructs aResourcewhose path is a relative path between thisgetPath()and the givenResource.getPath().Resolves an immediate child of thisResourcePath.
-
Method Details
-
getParent
ResourcePath getParent()- Returns:
- the parent
ResourcePathof thisResourcePathornullof thisResourcePathhas no parent
-
getPath
Ec4jPath getPath()- Returns:
- this path as a string; the segments are separated by slash
/
-
hasParent
boolean hasParent()- Returns:
trueif thisResourcePathhas parent;falseotherwise
-
relativize
Constructs aResourcewhose path is a relative path between thisgetPath()and the givenResource.getPath(). -
resolve
Resolves an immediate child of thisResourcePath.- Parameters:
name- the name of the child; should not contain path separators- Returns:
- the child
Resource
-