use of org.eclipse.core.internal.preferences.SafeFileInputStream in project che by eclipse.
the class ChePreferences method loadProperties.
protected static Properties loadProperties(String location) throws BackingStoreException {
// if (DEBUG_PREFERENCE_GENERAL)
// PrefsMessages.message("Loading preferences from file: " + location); //$NON-NLS-1$
InputStream input = null;
Properties result = new Properties();
try {
input = new SafeFileInputStream(new File(location));
result.load(input);
} catch (FileNotFoundException e) {
// PrefsMessages.message("Preference file does not exist: " + location); //$NON-NLS-1$
return result;
} catch (IOException e) {
// log(new Status(IStatus.INFO, PrefsMessages.OWNER_NAME, IStatus.INFO, message, e));
throw new BackingStoreException(e.getMessage(), e);
} finally {
if (input != null)
try {
input.close();
} catch (IOException e) {
// ignore
}
}
return result;
}
Aggregations