# Class ScriptProvider

Object
InstallationResources
InstallationScriptProvider
ScriptProvider

public class ScriptProvider extends InstallationScriptProvider
Provides SQL scripts for creating a local copy of the EPSG geodetic dataset. Provides also a copy of the EPSG Terms of Use, which should be accepted by users before the EPSG dataset can be installed.

## Notice

EPSG is maintained by the International Association of Oil and Gas Producers (IOGP) Surveying & Positioning Committee. The SQL scripts given by this class are derived from the EPSG scripts, but in a more compact format and with some EPSG lineage metadata omitted.

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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ScriptProvider()`
  Creates a new EPSG scripts provider.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getLicense(String authority, Locale locale, String mimeType)`
  Returns a copy of EPSG terms of use.
  `protected InputStream`
  `openStream(String name)`
  Returns the content for the SQL script of the given name.

  ### Methods inherited from class InstallationScriptProvider

  `getAuthorities, getResourceNames, openScript`

  ### Methods inherited from class InstallationResources

  `getInstructionURL, getResource, load`

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### ScriptProvider

    public ScriptProvider()
    Creates a new EPSG scripts provider.

- ## Method Details

  - ### getLicense

    public String getLicense(String authority, Locale locale, String mimeType) throws IOException
    Returns a copy of EPSG terms of use.
    Specified by:
      `getLicense` in class `InstallationResources`
    Parameters:
      `authority` - one of the values returned by `InstallationScriptProvider​.getAuthorities()`.
      `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 the specified MIME type is not recognized.
    Throws:
      `IOException` - if an error occurred while reading the license file.
    See Also:
      - https://epsg.org/terms-of-use.html

  - ### openStream

    protected InputStream openStream(String name)
    Returns the content for the SQL script of the given name. The file encoding is UTF-8.
    Specified by:
      `openStream` in class `InstallationScriptProvider`
    Parameters:
      `name` - either `"Tables​.sql"`, `"Data​.sql"` or `"FKeys​.sql"`.
    Returns:
      the SQL script of the given name, or `null` if the given name is not one of the expected names.