Package com.bc.ceres.resource
Class Resource
java.lang.Object
com.bc.ceres.resource.Resource
- Direct Known Subclasses:
FileResource
,ReaderResource
,StringResource
This class encapsulates the content of a resource. This can be either XML or
Java properties.
- Since:
- Ceres 0.13.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the exact copy of the content of the resource.getMap()
Returns an alphabetically sorted map, only if the content of the resource was a Java properties file.getPath()
Gets the path of the resource on the underlying file system.boolean
isXml()
True, if the content of the resource is of XML format.protected abstract String
read()
static String
toString()
Returns the exact copy of the content of the resource.
-
Constructor Details
-
Resource
Creates aResource
object for the given path.- Parameters:
path
- The path of this resource
-
-
Method Details
-
read
-
getPath
Gets the path of the resource on the underlying file system.- Returns:
- The path of the resource
-
getOrigin
-
isXml
public boolean isXml()True, if the content of the resource is of XML format.- Returns:
- True, if content is XML.
-
getContent
Returns the exact copy of the content of the resource.- Returns:
- The content of the resource.
-
getMap
Returns an alphabetically sorted map, only if the content of the resource was a Java properties file.- Returns:
- Properties as map.
-
toString
Returns the exact copy of the content of the resource. -
readText
- Throws:
IOException
-