Here you can find the source of saveProperties(Properties properties, File file)
Parameter | Description |
---|---|
properties | The properties |
file | The file |
Parameter | Description |
---|---|
IOException | In case of a writing error |
public static void saveProperties(Properties properties, File file) throws IOException
//package com.java2s; /**/* w w w .j av a 2 s. c om*/ * Copyright 2009-2016 Three Crickets LLC. * <p> * The contents of this file are subject to the terms of the LGPL version 3.0: * http://www.gnu.org/copyleft/lesser.html * <p> * Alternatively, you can obtain a royalty free commercial license with less * limitations, transferable or non-transferable, directly from Three Crickets * at http://threecrickets.com/ */ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.Properties; public class Main { /** * Saves properties to a file. * * @param properties * The properties * @param file * The file * @throws IOException * In case of a writing error */ public static void saveProperties(Properties properties, File file) throws IOException { FileOutputStream out = new FileOutputStream(file); try { properties.store(out, "Modifications you make to this file may be overriden by Prudence!"); } finally { out.close(); } } }