Class InstallationScriptProvider.Default
java.lang.Object
org.apache.sis.setup.InstallationResources
org.apache.sis.referencing.factory.sql.InstallationScriptProvider
org.apache.sis.referencing.factory.sql.InstallationScriptProvider.Default
- Enclosing class:
- InstallationScriptProvider
The default implementation which use the scripts in the
$SIS_DATA/Databases/ExternalSources
directory, if present. This class expects the files to have those exact names where * stands
for any characters provided that there is no ambiguity:
EPSG_*Tables.sqlEPSG_*Data.sqlEPSG_*FKeys.sql
- Since:
- 0.7
- Version:
- 0.7
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.referencing.factory.sql.InstallationScriptProvider
InstallationScriptProvider.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PathThe directory containing the scripts, ornullif it does not exist.private static final intIndex of the first real file in the array given to the constructor.Fields inherited from class org.apache.sis.referencing.factory.sql.InstallationScriptProvider
FINISH, PREPARE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns"EPSG"if the scripts exist in theExternalSourcessubdirectory, or"unavailable"otherwise.getLicense(String authority, Locale locale, String mimeType) Returnsnullsince the user is presumed to have downloaded the files himself.protected InputStreamopenStream(String name) Opens the input stream for the SQL script of the given name.Methods inherited from class org.apache.sis.referencing.factory.sql.InstallationScriptProvider
getResourceNames, log, openScriptMethods inherited from class org.apache.sis.setup.InstallationResources
getInstructionURL, getResource
-
Field Details
-
directory
The directory containing the scripts, ornullif it does not exist. -
FIRST_FILE
private static final int FIRST_FILEIndex of the first real file in the array given to the constructor. We set the value to 1 for skipping thePREPAREpseudo-file.- See Also:
-
-
Constructor Details
-
Default
Default(Locale locale) throws IOException Creates a default provider.- Parameters:
locale- the locale for warning messages, if any.- Throws:
IOException
-
-
Method Details
-
getAuthorities
Returns"EPSG"if the scripts exist in theExternalSourcessubdirectory, or"unavailable"otherwise.- Overrides:
getAuthoritiesin classInstallationScriptProvider- Returns:
"EPSG"if the SQL scripts for installing the EPSG dataset are available, or"unavailable"otherwise.
-
getLicense
Returnsnullsince the user is presumed to have downloaded the files himself.- Specified by:
getLicensein classInstallationResources- Parameters:
authority- one of the values returned byInstallationResources.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
nullif the license is presumed already accepted.
-
openStream
Opens the input stream for the SQL script of the given name.- Specified by:
openStreamin classInstallationScriptProvider- Parameters:
name- name of the script file to open.- Returns:
- an input stream opened of the given script file, or
nullif the resource was not found. - Throws:
IOException- if an error occurred while opening the file.
-