package com.hmsoft.common.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Properties;

/**
 * 
 * @author zq
 *
 */
public class SysCfgUtil {

	public static Properties loadFromFile(String path) throws FileNotFoundException, IOException {
		Properties props = new Properties();
		props.load(new FileInputStream(path));
		return props;
	}
	
	public static void storeToFile(Properties props, String path) throws IOException {
		OutputStream oFile = new FileOutputStream(new File(path));
		props.store(oFile, "Comment");
		oFile.close();
	}
}
