Package com.helger.io.resourceprovider
Interface IReadableResourceProvider
- All Known Subinterfaces:
IWritableResourceProvider
- All Known Implementing Classes:
ClassPathResourceProvider,DefaultResourceProvider,FileSystemResourceProvider,ReadableResourceProviderChain,URLResourceProvider,WritableResourceProviderChain
@MustImplementEqualsAndHashcode
public interface IReadableResourceProvider
Resource provider interface for readable resources.
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable InputStreamgetInputStream(@NonNull String sName) Get theInputStreamspecified by the given name for reading.@NonNull IReadableResourcegetReadableResource(@NonNull String sName) Get the resource specified by the given name for reading.booleansupportsReading(@Nullable 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.
-