Package org.ametys.core.cocoon.source
Class ResourceSource
java.lang.Object
org.apache.excalibur.source.impl.AbstractSource
org.ametys.core.cocoon.source.ResourceSource
- All Implemented Interfaces:
Source
Description of a source which is described by the resource protocol which
gets a resource from the classloader.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
exists()
protected void
getInfos()
Return anInputStream
object to read from the source.Get the location of the resourceReturnsNOPValidity.SHARED_INSTANCE
since a resource doesn't change.Methods inherited from class org.apache.excalibur.source.impl.AbstractSource
checkInfos, getContentLength, getLastModified, getScheme, getURI, refresh, setContentLength, setLastModified, setScheme, setSystemId
-
Constructor Details
-
ResourceSource
Constructor.- Parameters:
systemId
- URI of the desired resource- Throws:
MalformedURLException
- if the systemId is not like <scheme>://<path>SourceNotFoundException
- if the location can not be found in the class loader
-
-
Method Details
-
exists
-
getInfos
- Overrides:
getInfos
in classAbstractSource
-
getMimeType
- Specified by:
getMimeType
in interfaceSource
- Overrides:
getMimeType
in classAbstractSource
-
getInputStream
Return anInputStream
object to read from the source.- Specified by:
getInputStream
in interfaceSource
- Overrides:
getInputStream
in classAbstractSource
- Throws:
IOException
-
getValidity
ReturnsNOPValidity.SHARED_INSTANCE
since a resource doesn't change.- Specified by:
getValidity
in interfaceSource
- Overrides:
getValidity
in classAbstractSource
-
getLocation
Get the location of the resource- Returns:
- The location
-