Example usage for java.util.prefs InvalidPreferencesFormatException getMessage

List of usage examples for java.util.prefs InvalidPreferencesFormatException getMessage

Introduction

In this page you can find the example usage for java.util.prefs InvalidPreferencesFormatException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:com.symbian.utils.config.ConfigUtils.java

/**
 * load the Configuration settings from files.
 * //from  w ww.ja  v  a 2 s  . co m
 * @param aPrefFile
 *            The Java Preference file to import/load.
 * 
 * @throws IOException
 *             If the load doesn't work.
 */
public void importConfig(final File aPrefFile) throws IOException {
    try {
        Preferences.importPreferences(new FileInputStream(aPrefFile));
        iPrefrences = Preferences.userRoot().node(iNodeName);

    } catch (FileNotFoundException lFileNotFoundException) {
        throw new IOException("Cannot create new properties file: " + aPrefFile.getPath() + ": "
                + lFileNotFoundException.getMessage());
    } catch (IOException lIOException) {
        throw new IOException(
                "Properties file I/O error: " + aPrefFile.getPath() + ", " + lIOException.getMessage());
    } catch (InvalidPreferencesFormatException lIPFE) {
        throw new IOException(
                "Prefrences files are not valid: " + aPrefFile.getPath() + ", " + lIPFE.getMessage());
    }
}