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 TypeMethodDescriptionvoidaddResource(String name, String content) Adds a resource with the provided name and content.booleanremoveResource(String name) Removes the resource with the provided name.booleanupdateResource(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:
truewhen the resource was updated;falseotherwise- 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:
truewhen the resource was removed;falseotherwise- Throws:
ResourceWriterErrorException- if an error occurred during the resource removal.- Since:
- 1.0
-