Package org.apache.sis.console
Class ResourcesDownloader
Object
InstallationResources
OptionalInstallations
ResourcesDownloader
- All Implemented Interfaces:
- Localized
A provider for data licensed under different terms of use than the Apache license.
 This class is in charge of downloading the data if necessary and asking user's agreement
 before to install them. Authorities managed by the current implementation are:
 
- "EPSG"for the EPSG geodetic dataset.
- Since:
- 0.7
Defined in the sis-console module
- 
Field SummaryFields inherited from class OptionalInstallationsdestinationDirectory
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanaskUserAgreement(String authority, String license) Asks to the user if (s)he agree to download and install the resource for the given authority.Returns the name of the authority who provides data under non-Apache terms of use.Returns the locale to use for messages shown to the user.Methods inherited from class OptionalInstallationsgetLicense, getResource, getResourceNames, getSpaceRequirement, openScriptMethods inherited from class InstallationResourcesgetInstructionURL
- 
Constructor Details- 
ResourcesDownloaderpublic ResourcesDownloader()Creates a new installation scripts provider.
 
- 
- 
Method Details- 
getLocaleReturns the locale to use for messages shown to the user.- Specified by:
- getLocalein interface- Localized
- Overrides:
- getLocalein class- OptionalInstallations
- Returns:
- the locale of messages shown to the user.
 
- 
getAuthoritiesReturns the name of the authority who provides data under non-Apache terms of use. If thisResourcesDownloadercannot ask user's agreement because there is noConsoleattached to the current Java virtual machine, then this method returns an empty set.- Overrides:
- getAuthoritiesin class- OptionalInstallations
- Returns:
- "EPSG"or an empty set.
 
- 
askUserAgreementAsks to the user if (s)he agree to download and install the resource for the given authority. This method may be invoked twice for the sameauthorityargument: first with a nulllicenseargument for asking if the user agrees to download the data, then with a non-nulllicenseargument for asking if the user agrees with the license terms.- Specified by:
- askUserAgreementin class- OptionalInstallations
- Parameters:
- authority- one of the authorities returned by- OptionalInstallations.getAuthorities().
- license- the license, or- nullfor asking if the user wants to download the data.
- Returns:
- whether user accepted.
 
 
-