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 Type
    Method
    Description
    void
    addResource(String name, String content)
    Adds a resource with the provided name and content.
    boolean
    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

      void addResource(String name, String content) throws ResourceWriterErrorException
      Adds a resource with the provided name and content.
      Parameters:
      name - the name of the resource
      content - the content of the resource
      Throws:
      ResourceWriterErrorException - if an error occurred during the resource addition.
      Since:
      1.0
    • updateResource

      boolean updateResource(String name, String content) throws ResourceWriterErrorException
      Updates the content of the resource with the provided name.
      Parameters:
      name - the name of the resource
      content - 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

      boolean removeResource(String name) throws ResourceWriterErrorException
      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