• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to read a description of a file  RSS feed

 
kajalsingh singh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
Is it possible to read a human readable file description of a file from java code?
Thanks,
Kaj
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi kajalsingh,
can u explain ur requirements in little more details?
at first sight i would incline to answer the follwoing,
1. if u r on Unix then i would consider "ls -l" as the descriptive information for any file.
- you can run Runtime.exec() and then get its Process's outputstream to read in the output line and
- then parse/interpret the format you get in ls -l command and
- store it in some object for future reference in the code OR just print it on the screen after proper formatting
2. on DOS/Windows i would run 'dir' in similar manner and persome similar steps....
i guess i am not clear about what exactly you mean by "human readable format" you know...
regards
maulin
 
gautham kasinath
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well..
on the same lines as above.. you sure can read a *few* properties of the file using the file object.
I say *few* because M$word includes things like the author, summary, keywords etc for its documents which are legally a files properties.. esp. if you look @ a file as an object in real world.
A more clear question will give a clearer answer, I m afraid.
Regds
Lupo
 
kajalsingh singh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am developing a jsp that displays the files from a particular directory location.
How can I read all the properties of the file from the java code. Properties like Title, subject, comments and subject.
(Right click on the file->Properties and choose the Summary tab).
Thanks for you help,
Kaj
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!