Interface IReadableResourceProvider
- All Known Subinterfaces:
IWritableResourceProvider
- All Known Implementing Classes:
ClassPathResourceProvider,DefaultResourceProvider,FileSystemResourceProvider,ReadableResourceProviderChain,URLResourceProvider,WritableResourceProviderChain
Resource provider interface for readable resources.
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptiondefault InputStreamgetInputStream(String sName) Get theInputStreamspecified by the given name for reading.getReadableResource(String sName) Get the resource specified by the given name for reading.booleansupportsReading(String sName) Check if this resource provider can handle the resource with the passed name.
-
Method Details
-
supportsReading
Check if this resource provider can handle the resource with the passed name. If there is no real check on whether your resource provider can handle it, simply returntrue.- Parameters:
sName- The name to check. May benull.- Returns:
trueif the name is notnulland can be handled by this provider,falseotherwise.
-
getReadableResource
Get the resource specified by the given name for reading.- Parameters:
sName- The name of the resource to resolve.- Returns:
- The readable resource. Never
null.
-
getInputStream
Get theInputStreamspecified by the given name for reading. This method may be called without prior call tosupportsReading(String).- Parameters:
sName- The name of the resource to resolve.- Returns:
- The
InputStream. May benullif the underlying resource does not exist or ifsupportsReading(String)returnsfalse.
-