private void loadDefaultDialogSettingsFromBundle() { Bundle bundle = getBundle(); URL dsURL = BundleUtility.find(bundle, FN_DIALOG_SETTINGS); if (dsURL == null) { // no bundle defaults return; } try (BufferedReader reader = new BufferedReader( new InputStreamReader(dsURL.openStream(), StandardCharsets.UTF_8))) { dialogSettings.load(reader); } catch (IOException e) { getLog().log(new Status(IStatus.ERROR, bundle.getSymbolicName(), "Failed to load dialog settings from: " + dsURL, e)); //$NON-NLS-1$ // load failed so ensure we have an empty settings dialogSettings = createEmptySettings(); } }
/** * @return true if the workspace settings file was successfully read */ private boolean loadDialogSettingsFromWorkspace() { IPath dataLocation = getStateLocationOrNull(); if (dataLocation == null) { // bug 69387: The instance area should not be created (in the call to // #getStateLocation) if -data @none or -data @noDefault was used return false; } // try r/w state area in the local file system String readWritePath = dataLocation.append(FN_DIALOG_SETTINGS).toOSString(); File settingsFile = new File(readWritePath); if (settingsFile.exists()) { try { dialogSettings.load(readWritePath); } catch (IOException e) { // load failed so ensure we have an empty settings dialogSettings = createEmptySettings(); getLog().log(new Status(IStatus.ERROR, getBundle().getSymbolicName(), "Failed to load dialog settings from: " + settingsFile, e)); //$NON-NLS-1$ } return true; } return false; }
dialogSettings.load(reader); return true; } catch (IOException e) {