diff options
| author | Mark Wielaard <mark@gcc.gnu.org> | 2006-03-10 21:46:48 +0000 |
|---|---|---|
| committer | Mark Wielaard <mark@gcc.gnu.org> | 2006-03-10 21:46:48 +0000 |
| commit | 8aa540d2f783474d1d2e06f16744bf67b9c1facc (patch) | |
| tree | ea38c56431c5d4528fb54254c3f8e50f517bede3 /libjava/classpath/java/util/prefs/Preferences.java | |
| parent | 27079765d00123f8e53d0e1ef7f9d46559266e6d (diff) | |
Imported GNU Classpath 0.90
Imported GNU Classpath 0.90
* scripts/makemake.tcl: Set gnu/java/awt/peer/swing to ignore.
* gnu/classpath/jdwp/VMFrame.java (SIZE): New constant.
* java/lang/VMCompiler.java: Use gnu.java.security.hash.MD5.
* java/lang/Math.java: New override file.
* java/lang/Character.java: Merged from Classpath.
(start, end): Now 'int's.
(canonicalName): New field.
(CANONICAL_NAME, NO_SPACES_NAME, CONSTANT_NAME): New constants.
(UnicodeBlock): Added argument.
(of): New overload.
(forName): New method.
Updated unicode blocks.
(sets): Updated.
* sources.am: Regenerated.
* Makefile.in: Likewise.
From-SVN: r111942
Diffstat (limited to 'libjava/classpath/java/util/prefs/Preferences.java')
| -rw-r--r-- | libjava/classpath/java/util/prefs/Preferences.java | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/libjava/classpath/java/util/prefs/Preferences.java b/libjava/classpath/java/util/prefs/Preferences.java index 3fee1c5da74..a78381bfa1e 100644 --- a/libjava/classpath/java/util/prefs/Preferences.java +++ b/libjava/classpath/java/util/prefs/Preferences.java @@ -1,5 +1,5 @@ /* Preferences -- Preference node containing key value entries and subnodes - Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2001, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -90,12 +90,9 @@ public abstract class Preferences { /** * Default PreferencesFactory class used when the system property * "java.util.prefs.PreferencesFactory" is not set. - * <p> - * XXX - Currently set to MemoryBasedFactory, should be changed - * when FileBasedPreferences backend works. */ private static final String defaultFactoryClass - = "gnu.java.util.prefs.MemoryBasedFactory"; + = "gnu.java.util.prefs.FileBasedFactory"; /** Permission needed to access system or user root. */ private static final Permission prefsPermission @@ -219,8 +216,7 @@ public abstract class Preferences { catch (Exception e) { throw new RuntimeException ("Couldn't load default factory" - + " '"+ defaultFactoryClass +"'"); - // XXX - when using 1.4 compatible throwables add cause + + " '"+ defaultFactoryClass +"'", e); } } @@ -288,7 +284,13 @@ public abstract class Preferences { } /** - * XXX + * Import preferences from the given input stream. This expects + * preferences to be represented in XML as emitted by + * {@link #exportNode(OutputStream)} and + * {@link #exportSubtree(OutputStream)}. + * @throws IOException if there is an error while reading + * @throws InvalidPreferencesFormatException if the XML is not properly + * formatted */ public static void importPreferences(InputStream is) throws InvalidPreferencesFormatException, @@ -385,14 +387,28 @@ public abstract class Preferences { // abstract methods (export) /** - * XXX + * Export this node, but not its descendants, as XML to the + * indicated output stream. The XML will be encoded using UTF-8 + * and will use a specified document type:<br> + * <code><!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd"></code><br> + * @param os the output stream to which the XML is sent + * @throws BackingStoreException if preference data cannot be read + * @throws IOException if an error occurs while writing the XML + * @throws IllegalStateException if this node or an ancestor has been removed */ public abstract void exportNode(OutputStream os) throws BackingStoreException, IOException; /** - * XXX + * Export this node and all its descendants as XML to the + * indicated output stream. The XML will be encoded using UTF-8 + * and will use a specified document type:<br> + * <code><!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd"></code><br> + * @param os the output stream to which the XML is sent + * @throws BackingStoreException if preference data cannot be read + * @throws IOException if an error occurs while writing the XML + * @throws IllegalStateException if this node or an ancestor has been removed */ public abstract void exportSubtree(OutputStream os) throws BackingStoreException, |
