Java Properties Save saveConfig()

Here you can find the source of saveConfig()

Description

Save the current config to disk.

License

Open Source License

Exception

Parameter Description
IOException an exception

Declaration

public static void saveConfig() throws IOException 

Method Source Code


//package com.java2s;
/*/*from   ww w.j  a  va 2  s  .com*/
 * Copyright 2012,2013 Robert Huitema robert@42.co.nz
 * 
 * This file is part of FreeBoard. (http://www.42.co.nz/freeboard)
 *
 *  FreeBoard is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
    
 *  FreeBoard is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
    
 *  You should have received a copy of the GNU General Public License
 *  along with FreeBoard.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.io.File;

import java.io.FileWriter;
import java.io.IOException;

import java.util.Properties;

public class Main {
    private static Properties props;
    public static File cfg = null;

    /**
     * Save the current config to disk.
     * @throws IOException
     */
    public static void saveConfig() throws IOException {
        if (props == null)
            return;
        props.store(new FileWriter(cfg), null);

    }
}

Related

  1. save(File file, Properties properties)
  2. save(Properties properties, File propertiesFile)
  3. save(Properties props, File file, String comment)
  4. save(String fileName, CharSequence string)
  5. saveBuildConfiguration(IFile ifile)
  6. saveConfig(File settingsFile, Properties properties)
  7. saveDefaultScriptDirectory(String path)
  8. SaveDeployedObjects(String outputDirectory)
  9. saveInstalledChecksumCache(File dir, Map checksums)