Package org.ec4j.core
Class ResourcePath.ResourcePaths.ClassPathResourcePath
java.lang.Object
org.ec4j.core.ResourcePath.ResourcePaths.ClassPathResourcePath
- All Implemented Interfaces:
ResourcePath
- Enclosing class:
ResourcePath.ResourcePaths
static class ResourcePath.ResourcePaths.ClassPathResourcePath
extends Object
implements ResourcePath
A
ResourcePath implementation that loads resources from the current class path via the given
ClassLoader.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ec4j.core.ResourcePath
ResourcePath.ResourcePaths -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetPath()inthashCode()booleanrelativize(Resource resource) Constructs aResourcewhose path is a relative path between thisResourcePath.getPath()and the givenResource.getPath().Resolves an immediate child of thisResourcePath.toString()
-
Field Details
-
encoding
-
loader
-
path
-
-
Constructor Details
-
ClassPathResourcePath
ClassPathResourcePath(ClassLoader loader, Ec4jPath path, Charset encoding)
-
-
Method Details
-
equals
-
getParent
- Specified by:
getParentin interfaceResourcePath- Returns:
- the parent
ResourcePathof thisResourcePathornullof thisResourcePathhas no parent
-
getPath
- Specified by:
getPathin interfaceResourcePath- Returns:
- this path as a string; the segments are separated by slash
/
-
hashCode
public int hashCode() -
hasParent
public boolean hasParent()- Specified by:
hasParentin interfaceResourcePath- Returns:
trueif thisResourcePathhas parent;falseotherwise
-
relativize
Constructs aResourcewhose path is a relative path between thisResourcePath.getPath()and the givenResource.getPath().- Specified by:
relativizein interfaceResourcePath- Parameters:
resource- theResourceto relativize- Returns:
- a new relativized
Resource
-
resolve
Resolves an immediate child of thisResourcePath.- Specified by:
resolvein interfaceResourcePath- Parameters:
name- the name of the child; should not contain path separators- Returns:
- the child
Resource
-
toString
-