org.appng.api.model

## Interface Resources

- All Superinterfaces:
    AutoCloseable, Closeable
  All Known Implementing Classes:
    ApplicationResourceHolder

      public interface Resources
      extends Closeable

  A container providing easy access to the a `Application`s multiple `Resource`s.
  Author:
    Matthias Müller
  See Also:
    `Resource`, `Application`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `dumpToCache(ResourceType... types)` Writes all `Resource`s to the local caching location.
    `ApplicationInfo` | `getApplicationInfo()` Returns the `ApplicationInfo`, read from the `Application`'s `application-info.xml`.
    `Resource` | `getResource(Integer id)` Returns the `Resource` with the given ID.
    `Resource` | `getResource(ResourceType type, String fileName)` Returns the `Resource` of the given type with the given name, if any.
    `Set<Resource>` | `getResources()` Returns the underlying `Resource`
    `Set<Resource>` | `getResources(ResourceType type)` Returns all `Resource`s of the given `ResourceType`.

- - ### Method Detail

    - #### getResources

          Set<Resource> getResources(ResourceType type)

      Returns all `Resource`s of the given `ResourceType`.
      Parameters:
        `type` - the ResourceType
      Returns:
        the `Resource`s of the given `ResourceType`

    - #### dumpToCache

          void dumpToCache(ResourceType... types)

      Writes all `Resource`s to the local caching location.
      Parameters:
        `types` - the types to write the cachefiles for
      See Also:
        `Resource.getCachedFile()`

    - #### getResource

          Resource getResource(ResourceType type,
                               String fileName)

      Returns the `Resource` of the given type with the given name, if any.
      Parameters:
        `type` - the `ResourceType` of the `Resource`
        `fileName` - the name of the `Resource`
      Returns:
        the `Resource`, or `null` if no such `Resource` exists.

    - #### getResources

          Set<Resource> getResources()

      Returns the underlying `Resource`
      Returns:
        the underlying `Resource`s

    - #### getResource

          Resource getResource(Integer id)

      Returns the `Resource` with the given ID.
      Parameters:
        `id` - the ID of the `Resource`
      Returns:
        the `Resource`, or `null` if no such resource exists.

    - #### getApplicationInfo

          ApplicationInfo getApplicationInfo()

      Returns the `ApplicationInfo`, read from the `Application`'s `application-info.xml`.
      Returns:
        the `ApplicationInfo`

    - #### close

          void close()
              throws IOException

      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `Closeable`
      Throws:
        `IOException`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.