All pastes #334339 Raw Edit

Miscellany

public java v1 · immutable
#334339 ·published 2007-01-31 14:57 UTC
rendered paste body
import java.util.*;import java.io.*;public class PropertiesConfig {        public void SaveConfig(String _option, String _value) {                String filename, option = _option, value = _value;                File file;        Properties properties;                InputStream input;        OutputStream output;                        filename = "/tmp/LansinTVserver.config";        file = new File(filename);                try {                        if(!file.exists()) {                System.out.println(filename + " does not exist.  Creating file.");                file.createNewFile();            }                        properties = new Properties();            properties.load(input = new FileInputStream(file));            input.close();                        properties.setProperty(option, value);            //properties.remove(key);            //properties.list(System.out);                                                properties.store(output = new FileOutputStream(file), null);            output.close();                    } catch(IOException e) {            e.printStackTrace();        }            }    }