1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
/** Gets the complete list of the properties' keys in a sorted array.
* @return A sorted array.
*/
public String[] toKeyArray() {
Enumeration keyList = keys();
String[] keyArray = new String[size()];
for (int i = 0; i < keyArray.length; i++) {
keyArray[i] = (String) keyList.nextElement();
}
Arrays.sort(keyArray);
return keyArray;
}
public void store(OutputStream out, String header) throws IOException {
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, "8859-1"));
/////////////////
// Write content.
String[] keyArray = toKeyArray();
StringBuilder lineBuffer = null;
for (int i = 0; i < keyArray.length; i++) {
String key = keyArray[i];
String value = (String) get(key);
... |