Interface ResourceSelector<R extends Resource>

Type Parameters:
R - The type of resource being selected.
All Superinterfaces:
Preferencesable, URIAccessible, URIInputStreamable, URIOutputStreamable

public interface ResourceSelector<R extends Resource> extends URIAccessible, Preferencesable
An interface to an object that allows resources to be selected for input or output.
Author:
Garret Wilson
  • Method Details

    • getResource

      R getResource(URI referenceURI) throws IOException
      Retrieves a description of the resource with the given reference URI.
      Parameters:
      referenceURI - The reference URI of the resource in question.
      Returns:
      A description of the identified resource.
      Throws:
      IOException - Thrown if there is an error retrieving the resource description.
    • selectInputResource

      R selectInputResource(R oldResource) throws SecurityException, IOException
      Selects a resource for input.
      Parameters:
      oldResource - The currently selected resource, if applicable, or null if there is no selected resource.
      Returns:
      The selected resource, or null if selection was canceled.
      Throws:
      SecurityException - Thrown if selecting an input resource is not allowed.
      IOException - Thrown if there is an error locating a resource.
    • selectOutputResource

      R selectOutputResource(R oldResource) throws SecurityException, IOException
      Selects a resource for output.
      Parameters:
      oldResource - The currently selected resource, if applicable, or null if there is no selected resource.
      Returns:
      The selected resource, or null if selection was canceled.
      Throws:
      SecurityException - Thrown if selecting an output resource is not allowed.
      IOException - Thrown if there is an error locating a resource.