• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to read a description of a file

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic