Package org.zkoss.util.resource

## Interface Locator

- All Known Subinterfaces:
    `WebApp`, `XMLResourcesLocator`
  All Known Implementing Classes:
    `AbstractWebApp`, `ClassLocator`, `ServletContextLocator`, `SimpleWebApp`

      public interface Locator

  A locator that is able to locate a resource.
  Author:
    tomyeh
  See Also:
    `Locators.getDefault()`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String` | `getDirectory()` | Returns the directory used to resolve the relative path, or null if relative path is not allowed.
    `java.net.URL` | `getResource​(java.lang.String name)` | Finds the resource with the given name.
    `java.io.InputStream` | `getResourceAsStream​(java.lang.String name)` | Returns an input stream for reading the specified resource.

- - ### Method Detail

    - #### getDirectory

          java.lang.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

          java.net.URL getResource​(java.lang.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

          java.io.InputStream getResourceAsStream​(java.lang.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