Interface IResourceManager
- All Known Implementing Classes:
CompositeResourceManager
,DefaultResourceManager
,FileResourceManager
,FileSystemResourceManager
,LinkedResourceManager
,PackageResourceManager
,RelativeResourceManager
,ResourceManagerBase
,UrlResourceManager
public interface IResourceManager
This class is responsible for locating resources which are residing in different protocols. Fallback mechanisms are
supported, a returned resource is bound to a protocol.
A protocol can be a classpath:, assembly:, or file:.
- Since:
- 6.0
- Author:
- F. van der Meer, O. Kerpershoek
-
Method Summary
Modifier and TypeMethodDescriptiongetResource
(String path) Locates a resource specified by path.String[]
Returns the supported protocol types.
-
Method Details
-
getResource
Locates a resource specified by path. Path may contain a protocol prefix to specify that the resource should be located from a specific resource manager. This method will only return a result when the resource is available. When the resource manager can not locate the requested resource, an UnknownResourceException will be thrown.- Parameters:
path
- the path to the resource.- Returns:
- A resource that will exist, exception otherwise.
- Throws:
ResourceException
- When the resource could not be retrieved from the resource manager.
-
getSupportedTypes
String[] getSupportedTypes()Returns the supported protocol types.- Returns:
- a list of supported types, which should never be null.
-