Java Properties Save saveUserSettings(Properties properties)

Here you can find the source of saveUserSettings(Properties properties)

Description

save User Settings

License

Open Source License

Declaration

private static void saveUserSettings(Properties properties) 

Method Source Code

//package com.java2s;

import java.io.BufferedOutputStream;
import java.io.File;

import java.io.FileOutputStream;
import java.io.IOException;

import java.io.OutputStream;

import java.util.Properties;

public class Main {
    private static void saveUserSettings(Properties properties) {
        String filename = System.getProperty("user.home") + File.separator + ".RacePoint.xml";
        OutputStream out = null;//from   w w  w .  jav  a 2 s.  c  o  m
        try {
            out = new FileOutputStream(filename);
            BufferedOutputStream outBuf = new BufferedOutputStream(out);
            properties.storeToXML(outBuf, "User settings for RacePoint");
            outBuf.close();
        } catch (IOException e) {
        } finally {
            if (out != null) {
                try {
                    out.close();
                } catch (IOException e) {
                }
            }
        }
    }
}

Related

  1. saveProps(Properties p, String fname, String comment)
  2. saveProps(String path, Properties props)
  3. saveSorted(Properties props, File file)
  4. saveSysDirProperties(Properties sysProps, String classpathDirectory)
  5. saveToFile(Properties prop, String fileName)
  6. serialize(Properties properties)
  7. serialize(Properties props)