We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
package java.util.prefs; Preferences.class private static PreferencesFactory factory1() { // 2. Try service provider interface Iterator i = Service.providers(PreferencesFactory.class, ClassLoader.getSystemClassLoader()); // choose first provider instance while (i.hasNext()) { try { return (PreferencesFactory) i.next(); } catch (ServiceConfigurationError sce) { if (sce.getCause() instanceof SecurityException) { // Ignore the security exception, try the next provider continue; } throw sce; } } // 3. Use platform-specific system-wide default String platformFactory = System.getProperty("os.name").startsWith("Windows") ? "java.util.prefs.WindowsPreferencesFactory" : "java.util.prefs.FileSystemPreferencesFactory"; try { return () Class.forName(platformFactory, false, null).newInstance(); } catch (Exception e) { InternalError error = new InternalError( "Can't instantiate platform default Preferences factory "PreferencesFactory + platformFactory); error.initCause(e); throw error; } }
// to recover a configuration made before