Java Properties Save saveProperties(Properties p, String sFile)

Here you can find the source of saveProperties(Properties p, String sFile)

Description

Menyimpan file properties ke file

License

Open Source License

Parameter

Parameter Description
p Objek Properties
sFile String path file tujuan

Declaration

public static void saveProperties(Properties p, String sFile) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.FileOutputStream;

import java.io.IOException;

import java.util.Properties;

public class Main {
    /**/*from w  ww  .  ja  v  a 2s .c  o m*/
     * Menyimpan file properties ke file
     * @param p Objek Properties
     * @param sFile String path file tujuan
     */
    public static void saveProperties(Properties p, String sFile) {
        try {
            FileOutputStream out = new FileOutputStream(sFile);
            p.store(out, "Ini baris komentar\nFile Konfigurasi");
            System.out.println("File konfigurasi disimpan.....");
            out.close();
        } catch (IOException ex) {
            System.out.println(ex.getMessage());
        }
    }
}

Related

  1. saveProperties()
  2. saveProperties(final IResource modelResource, final Properties props)
  3. saveProperties(Map map, File file, String encoding)
  4. saveProperties(Map map, Writer tmpWriter)
  5. saveProperties(Properties p, String file)
  6. saveProperties(Properties prop, String fileName, String remark)
  7. saveProperties(Properties properties, File file)
  8. saveProperties(Properties properties, File propertiesFile, String comments)
  9. saveProperties(Properties properties, File propertyFile)