1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.project.management;
15 import java.io.FileReader;
16 import java.io.FileWriter;
17 import java.io.IOException;
18 import java.util.Properties;
21 * Workspace management utils
23 * @author Toni Kalajainen <toni.kalajainen@vtt.fi>
25 public class WorkspaceUtil {
28 * Write project properties
30 * Project URI is in a text file simantics.cfg
36 public static void writeProperties(File propertyFile, Properties props) throws IOException {
39 fw = new FileWriter( propertyFile );
40 props.store(fw, "Project configuration");
42 if (fw!=null) fw.close();
47 * Read project properties in a workspace
53 public static Properties readProperties(File propertyFile) throws IOException {
56 fr = new FileReader(propertyFile);
57 Properties props = new Properties();
61 if (fr!=null) fr.close();