Interface Locator

All Known Subinterfaces:
XMLResourcesLocator
All Known Implementing Classes:
ClassLocator

public interface Locator
A locator that is able to locate a resource.
Author:
tomyeh
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the directory used to resolve the relative path, or null if relative path is not allowed.
    Finds the resource with the given name.
    Returns an input stream for reading the specified resource.
  • Method Details

    • getDirectory

      String getDirectory()
      Returns the directory used to resolve the relative path, or null if relative path is not allowed.

      Note: if the returned directory is not null, it must end with '/'.

    • getResource

      URL getResource(String name)
      Finds the resource with the given name. A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code.
      Returns:
      a URL for reading the resource, or null if the resource could not be found or the caller doesn't have adequate privileges to get the resource
    • getResourceAsStream

      InputStream getResourceAsStream(String name)
      Returns an input stream for reading the specified resource.
      Returns:
      an input stream for reading the resource, or null if the resource could not be found or the caller doesn't have adequate privileges to get the resource