Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Properties - reposted


  • From: esse@xxxxxxxxxxx (esse@xxxxxxxxxxx)
  • Subject: Properties - reposted
  • Date: Wed, 29 Dec 1999 12:57:07 -0200

I understand the subject treated here may not be of interest to many,
but I invite all of you to run the code below to see that the
Properties' save() method is not saving the list of keys to the file.

After looking into the file I only saw this:

#Here it goes...
#Tue Dec 28 13:29:47 GMT-02:00 1999

Why this behavior?

I would like to receive even a short report about the running by other
people to see whether the problem is with the method itself or somewhere
else.

Letra

import java.util.*;
import java.io.*;

class P {
public static void main(String[] a) throws IOException {

Properties p1=new Properties(System.getProperties());
FileOutputStream f1=new FileOutputStream("O.O");
p1.save(f1, "Here it goes...");

/*
public synchronized void save(OutputStream out, String header)
Stores this property LIST to the specified output stream. The string
header is printed as a comment at the beginning of the stream.
*/

Properties p2=new Properties();
FileInputStream f2=new FileInputStream("O.O");
p2.load(f2);
p2.list(System.out);
}
}

---
To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx