Java Properties Load from File loadUserSettings()

Here you can find the source of loadUserSettings()

Description

load User Settings

License

Open Source License

Declaration

private static Properties loadUserSettings() 

Method Source Code


//package com.java2s;

import java.io.BufferedInputStream;

import java.io.File;
import java.io.FileInputStream;

import java.io.IOException;
import java.io.InputStream;

import java.util.Properties;

public class Main {
    private static Properties loadUserSettings() {
        String filename = System.getProperty("user.home") + File.separator + ".RacePoint.xml";
        Properties result = new Properties();
        InputStream in = null;/*from w ww  .j  ava2s  . c o m*/
        try {
            in = new FileInputStream(filename);
            BufferedInputStream inBuf = new BufferedInputStream(in);
            result.loadFromXML(inBuf);
            inBuf.close();
        } catch (IOException e) {
            result = new Properties();
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException e) {
                }
            }
        }
        return result;
    }
}

Related

  1. loadSystemProperty(String evn, String fileName)
  2. loadTestProperties(String filename)
  3. loadToStringFromFile(String fullFileName)
  4. loadTrimedProperties(String filename)
  5. loadUniversal(InputStream in)
  6. loadWithNormalMode(final String propertyFilePath)
  7. loadWithTrimmedValues(InputStream iStr, Properties prop)