Here you can find the source of saveProperties(String fileName, Properties properties, String title)
final static public void saveProperties(String fileName, Properties properties, String title)
//package com.java2s; import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.Properties; public class Main { private static String fUserHome = System.getProperty("user.home"); private static char fFileSeparator = System.getProperty("file.separator").charAt(0); private static char fLastCharOfDirectory = fUserHome.charAt(fUserHome.length() - 1); final static public void saveProperties(String fileName, Properties properties, String title) { try {//from w w w. ja va 2 s. c om FileOutputStream fos = new FileOutputStream(makeFullPathname(fileName)); BufferedOutputStream bos = new BufferedOutputStream(fos); properties.store(bos, title); bos.close(); fos.close(); } catch (IOException e) { e.printStackTrace(); } } static public String makeFullPathname(String fileName) { if (fLastCharOfDirectory == fFileSeparator) return fUserHome + fileName; else return fUserHome + fFileSeparator + fileName; } }