• Post Reply Bookmark Topic Watch Topic
  • New Topic

reading the file properties in English  RSS feed

 
Ranch Hand
Posts: 62
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
my requirement is to know all the properties of a file.

for this i have written this code shown below, but it writes the data(properties of a file) in BINARY in the Images.ini file

Properties p1 = new Properties();
FileInputStream fp1 = new FileInputStream("c:\cricket.txt");
p1.load(fp1);
Enumeration myenum = p1.propertyNames();
PrintWriter pw = new PrintWriter(new FileWriter("ImagesA.ini"));
p1.list(pw);
pw.close();
fp1 = null;
p1 = null;

Is it possible to get the output in english

thanks
 
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what your requirement is, exactly, or precisely what you mean here by "binary" or "English". The "list" method basically provides a debug display of what's in a Properties object -- it's text, not "binary", although it's certainly not handsome, formatted text.

What you will probably want to do is take the Enumeration "myenum" that you've created, and iterate over it, printing each key to the PrintWriter in whatever format you choose.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!