# Class EmbeddedResources

Object
InstallationResources
EmbeddedResources

public class EmbeddedResources extends InstallationResources
Provides an embedded database for the EPSG geodetic dataset and other resources. Provides also a copy of the EPSG terms of use, which should be accepted by users before the EPSG dataset can be installed.

Since:
  0.8
See Also:
  - https://epsg.org/

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EmbeddedResources()`
  Creates a new provider for connections to the embedded database.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Set<String>`
  `getAuthorities()`
  Returns the pseudo-authority, which is `"Embedded"`.
  `String`
  `getLicense(String authority, Locale locale, String mimeType)`
  Returns the license of embedded data.
  `DataSource`
  `getResource(String authority, int index)`
  Returns the data source for embedded database.
  `String[]`
  `getResourceNames(String authority)`
  Returns the data source name, which is `"SpatialMetadata"`.
  `BufferedReader`
  `openScript(String authority, int resource)`
  Unconditionally throws an exception since the embedded database is not provided as SQL scripts.

  ### Methods inherited from class InstallationResources

  `getInstructionURL, load`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### EmbeddedResources

    public EmbeddedResources()
    Creates a new provider for connections to the embedded database.

- ## Method Details

  - ### getAuthorities

    public Set<String> getAuthorities()
    Returns the pseudo-authority, which is `"Embedded"`.
    Specified by:
      `getAuthorities` in class `InstallationResources`
    Returns:
      `"Embedded"` pseudo-authority.

  - ### getLicense

    public String getLicense(String authority, Locale locale, String mimeType) throws IOException
    Returns the license of embedded data.
    Specified by:
      `getLicense` in class `InstallationResources`
    Parameters:
      `authority` - shall be `"Embedded"`.
      `locale` - the preferred locale for the terms of use.
      `mimeType` - either `"text/plain"` or `"text/html"`.
    Returns:
      the terms of use in plain text or HTML, or `null` if none.
    Throws:
      `IllegalArgumentException` - if the given `authority` argument is not the expected values.
      `IOException` - if an error occurred while reading the license file.

  - ### getResourceNames

    public String[] getResourceNames(String authority)
    Returns the data source name, which is `"SpatialMetadata"`.
    Specified by:
      `getResourceNames` in class `InstallationResources`
    Parameters:
      `authority` - shall be `"Embedded"`.
    Returns:
      `"SpatialMetadata"`.

  - ### getResource

    public DataSource getResource(String authority, int index)
    Returns the data source for embedded database.
    Overrides:
      `getResource` in class `InstallationResources`
    Parameters:
      `authority` - shall be `"Embedded"`.
      `index` - shall be 0.
    Returns:
      the embedded data source, or `null` if not available.
    See Also:
      - `ClassLoader​.getResource(String)`

  - ### openScript

    public BufferedReader openScript(String authority, int resource) throws IOException
    Unconditionally throws an exception since the embedded database is not provided as SQL scripts.
    Specified by:
      `openScript` in class `InstallationResources`
    Parameters:
      `authority` - shall be `"Embedded"`.
      `resource` - shall be 0.
    Returns:
      never return.
    Throws:
      `IOException` - always thrown.