Package rife.resources
Interface ResourceWriter
- All Known Implementing Classes:
DatabaseResources
,MemoryResources
public interface ResourceWriter
This interface defines the methods that classes with
ResourceWriter
functionalities have to implement.
A ResourceWriter
provides an abstract way of modifying
resources. According to a name, a resource and its content can be added,
updated or removed.
- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addResource
(String name, String content) Adds a resource with the provided name and content.boolean
removeResource
(String name) Removes the resource with the provided name.boolean
updateResource
(String name, String content) Updates the content of the resource with the provided name.
-
Method Details
-
addResource
Adds a resource with the provided name and content.- Parameters:
name
- the name of the resourcecontent
- the content of the resource- Throws:
ResourceWriterErrorException
- if an error occurred during the resource addition.- Since:
- 1.0
-
updateResource
Updates the content of the resource with the provided name.- Parameters:
name
- the name of the resourcecontent
- the content of the resource- Returns:
true
when the resource was updated;false
otherwise- Throws:
ResourceWriterErrorException
- if an error occurred during the resource update.- Since:
- 1.0
-
removeResource
Removes the resource with the provided name.- Parameters:
name
- the name of the resource- Returns:
true
when the resource was removed;false
otherwise- Throws:
ResourceWriterErrorException
- if an error occurred during the resource removal.- Since:
- 1.0
-