use of org.eclipse.core.runtime.preferences.IPreferencesService in project titan.EclipsePlug-ins by eclipse.
the class LicenseValidator method getResolvedLicenseFilePath.
/**
* Calculates and returns the path of the license file resolved to be
* directly usable in the actual environment.
*
* @param force
* weather to update the value if it already exist or
* not.
* @return the resolved license file path
*/
public static String getResolvedLicenseFilePath(final boolean force) {
if (!License.isLicenseNeeded()) {
return "";
}
final IPreferencesService preferenceService = Platform.getPreferencesService();
final boolean reportDebugInformation = preferenceService.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.DISPLAYDEBUGINFORMATION, false, null);
if (force || resolvedLicenseFilePath.length() == 0) {
final String licensePath = preferenceService.getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.LICENSE_FILE_PATH, "", null);
resolvedLicenseFilePath = PathConverter.convert(licensePath, reportDebugInformation, TITANDebugConsole.getConsole());
}
return resolvedLicenseFilePath;
}
Aggregations