2
2
package org.crosswire.common.util;
7
import org.crosswire.common.util.*;
4
import java.io.BufferedReader;
5
import java.io.BufferedWriter;
6
import java.io.ByteArrayInputStream;
7
import java.io.IOException;
8
import java.io.InputStream;
9
import java.io.InputStreamReader;
10
import java.io.OutputStream;
11
import java.io.OutputStreamWriter;
12
import java.util.Date;
13
import java.util.Iterator;
14
import java.util.Properties;
10
17
* A generic class of Properties utils.
11
18
* It would be good if we could put this stuff in java.lang ...
20
* <p><table border='1' cellPadding='3' cellSpacing='0'>
21
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
13
* <table border='1' cellPadding='3' cellSpacing='0' width="100%">
14
* <tr><td bgColor='white'class='TableRowColor'><font size='-7'>
15
23
* Distribution Licence:<br />
16
* Project B is free software; you can redistribute it
24
* JSword is free software; you can redistribute it
17
25
* and/or modify it under the terms of the GNU General Public License,
18
26
* version 2 as published by the Free Software Foundation.<br />
19
27
* This program is distributed in the hope that it will be useful,
21
29
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
30
* General Public License for more details.<br />
23
31
* The License is available on the internet
24
* <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, by writing to
25
* <i>Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
26
* MA 02111-1307, USA</i>, Or locally at the Licence link below.<br />
32
* <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, or by writing to:
33
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
34
* MA 02111-1307, USA<br />
27
35
* The copyright to this program is held by it's authors.
28
36
* </font></td></tr></table>
29
* @see <a href='http://www.eireneh.com/servlets/Web'>Project B Home</a>
30
* @see <{docs.Licence}>
38
* @author Joe Walker [joe at eireneh dot com]
33
41
public class PropertiesUtil
59
67
writeln(awriter, "#" + header);
61
69
writeln(awriter, "#" + new Date().toString());
62
for (Enumeration e = prop.keys(); e.hasMoreElements();)
70
for (Iterator it = prop.keySet().iterator(); it.hasNext();)
64
String key = (String) e.nextElement();
72
String key = (String) it.next();
65
73
String val = (String) prop.get(key);
66
74
key = saveConvert(key);
67
75
val = saveConvert(val);