Here you can find the source of saveProperties(String fileName, Properties properties)
public static boolean saveProperties(String fileName, Properties properties)
//package com.java2s; //License from project: Open Source License import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.Properties; public class Main { public static boolean saveProperties(String fileName, Properties properties) { FileOutputStream fos = null; try {//from w w w . j a va 2 s. co m fos = new FileOutputStream(fileName); properties.store(fos, null); } catch (FileNotFoundException ex) { System.out.println("The server configuration properties file not exists"); } catch (IOException ioe) { System.out.println("The property file configuration wrintng error"); } finally { try { fos.close(); } catch (IOException ex) { //Logger.getLogger(AppVirClientConfigJFrame.class.getName()).log(Level.SEVERE, null, ex); } } return false; } }