java.lang.Object
org.apache.sis.setup.InstallationResources
org.apache.sis.resources.embedded.EmbeddedResources

public class EmbeddedResources extends org.apache.sis.setup.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
Version:
1.4
Author:
Martin Desruisseaux (Geomatys)
See Also:
  • 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 org.apache.sis.setup.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 org.apache.sis.setup.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 org.apache.sis.setup.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 org.apache.sis.setup.InstallationResources
      Parameters:
      authority - shall be "Embedded".
      index - shall be 0.
      Returns:
      the embedded data source.
    • 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 org.apache.sis.setup.InstallationResources
      Parameters:
      authority - shall be "Embedded".
      resource - shall be 0.
      Returns:
      never return.
      Throws:
      IOException - always thrown.