• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

How to set/modify Windows File Properties via Java?

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My program creates Microsoft Excel Regression Functions, and saves them as *.bas files (Visual Basic for Applications). When I create these text files in Java, I want to assign file properties to them. These are the properties that are called up in Windows by right clicking on the file and selecting PROPERTIES->SUMMARY->ADVANCED.

Windows allows a Title, Subject, Keywords, and other Meta-information to be stored here.

I have done an hour of searching, and have not yet found anything. Any help would be appreciated.
Java Cowboy
Posts: 16084
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think it is possible to do this in Windows for plain text files.

The properties that you see for Excel (*.xls) and Word (*.doc) documents are just data stored somewhere in the file, and Windows Explorer knows how to read that metadata from Microsoft Office documents.

The Windows file system (FAT or NTFS) doesn't have a feature for storing arbitrary metadata for any file type, as far as I know.

This is a very Windows-specific question, so even if it were possible, you won't find anything in the standard Java API to do it. Maybe you can find more info on how this works in Windows in the MSDN Library.
[ June 13, 2006: Message edited by: Jesper Young ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!