Interface ResourceManager.Manager<T>

Type Parameters:
T - the generic type of the resource being managed
Enclosing class:
ResourceManager

public static interface ResourceManager.Manager<T>
Simple manager to handle saving and retrieving resources of different kinds, for example from projects or a user directory.

Examples of resources are scripts or classifiers. Several of these may be stored per project, and may be identified by name.

Author:
Pete Bankhead
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Returns true if the manager knows a resource with the specified name exists.
    get(String name)
    Retrieve a resource by name.
    Get a list of the available resources.
    void
    put(String name, T resource)
    Save a resource within the project.
    boolean
    remove(String name)
    Remove a resource within the project.
  • Method Details

    • getNames

      Collection<String> getNames() throws IOException
      Get a list of the available resources.
      Returns:
      Throws:
      IOException
    • get

      T get(String name) throws IOException
      Retrieve a resource by name.
      Parameters:
      name -
      Returns:
      Throws:
      IOException
    • put

      void put(String name, T resource) throws IOException
      Save a resource within the project.
      Parameters:
      name -
      resource -
      Throws:
      IOException
    • remove

      boolean remove(String name) throws IOException
      Remove a resource within the project.
      Parameters:
      name -
      Returns:
      true if a resource was successfully removed, false otherwise
      Throws:
      IOException
    • contains

      default boolean contains(String name) throws IOException
      Returns true if the manager knows a resource with the specified name exists.
      Parameters:
      name - the name to check
      Returns:
      true if a resource with the name exists, false otherwise
      Throws:
      IOException