Java Properties Save save()

Here you can find the source of save()

Description

save

License

Open Source License

Declaration

public static void save() 

Method Source Code

//package com.java2s;

import java.io.FileOutputStream;

import java.util.Properties;

public class Main {
    static Properties p = new Properties();
    static String cfgPath;

    public static void save() {
        try {//from w  ww .j av  a  2s  .  c o m
            FileOutputStream fos = new FileOutputStream(cfgPath);
            p.setProperty("bbb", "333444");
            p.store(fos, "");
            fos.flush();
            fos.close();
            System.out.println("store properties success");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Related

  1. save()
  2. save(File file, Properties properties)
  3. save(Properties properties, File propertiesFile)
  4. save(Properties props, File file, String comment)
  5. save(String fileName, CharSequence string)