Package org.ec4j.core
Class Resource.Resources.ClassPathResource
java.lang.Object
org.ec4j.core.Resource.Resources.ClassPathResource
- All Implemented Interfaces:
Resource
- Enclosing class:
Resource.Resources
A
Resource 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.Resource
Resource.Bom, Resource.Charsets, Resource.RandomReader, Resource.Resources -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanexists()getPath()inthashCode()Opens aResource.RandomReaderto read the content of thisResource.private static StringremoveInitialSlash(Ec4jPath path) toString()
-
Field Details
-
encoding
-
loader
-
path
-
-
Constructor Details
-
ClassPathResource
ClassPathResource(ClassLoader loader, Ec4jPath path, Charset encoding)
-
-
Method Details
-
removeInitialSlash
-
equals
-
exists
public boolean exists() -
getParent
- Specified by:
getParentin interfaceResource- Returns:
- the
ResourcePathof the parent of thisResourceornullif thisResourcehas no parent
-
getPath
-
hashCode
public int hashCode() -
openRandomReader
Opens aResource.RandomReaderto read the content of thisResource.- Specified by:
openRandomReaderin interfaceResource- Returns:
- an open
Resource.RandomReader - Throws:
IOException- on I/O problems
-
openReader
- Specified by:
openReaderin interfaceResource- Returns:
- an open
Reader - Throws:
IOException
-
toString
-