Importing Preferences - Java Native OS

Java examples for Native OS:Preference

Description

Importing Preferences

Demo Code

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.prefs.InvalidPreferencesFormatException;
import java.util.prefs.Preferences;

public class Main {
  public static void main(String[] args) {
    // Create an input stream on a file
    InputStream is = null;/* ww w . java 2s . c o  m*/
    try {
      is = new BufferedInputStream(new FileInputStream("output.xml"));

      Preferences.importPreferences(is);
    } catch (InvalidPreferencesFormatException e) {
    } catch (IOException e) {
    }
  }
}

Related Tutorials