Class FileResourceManager
- java.lang.Object
-
- com.aquima.interactions.foundation.io.ResourceManagerBase
-
- com.aquima.interactions.foundation.io.FileResourceManager
-
- All Implemented Interfaces:
IResourceManager
public class FileResourceManager extends ResourceManagerBase
Resource manager implementation that uses a file system to locate the resources.- Since:
- 6.0
- Author:
- F. van der Meer, O. Kerpershoek
-
-
Field Summary
-
Fields inherited from class com.aquima.interactions.foundation.io.ResourceManagerBase
SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description FileResourceManager(String protocol, File folder)
Constructs the file resource manager for the specified resource folder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IResource
getResource(String path)
Locates a resource specified by path.String[]
getSupportedTypes()
Returns the supported protocol types.String
toString()
-
Methods inherited from class com.aquima.interactions.foundation.io.ResourceManagerBase
getResourceRef, isSupportedProtocol, isSupportedProtocol
-
-
-
-
Constructor Detail
-
FileResourceManager
public FileResourceManager(String protocol, File folder)
Constructs the file resource manager for the specified resource folder.- Parameters:
protocol
- The protocol name that should be used by this resource manager.folder
- The resource folder that should be used by the resource manager.
-
-
Method Detail
-
getResource
public IResource getResource(String path) throws ResourceException
Description copied from interface:IResourceManager
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
public String[] getSupportedTypes()
Description copied from interface:IResourceManager
Returns the supported protocol types.- Returns:
- a list of supported types, which should never be null.
-
-