CdB
CdB

Reputation: 4908

Use java to read metadata/properties of text files (.txt)

I have created a a java class that is used to get/set document's metadata (like author, subject etc).
I use pdfBox Library for pdf files and apache poi library for ms office documents and they 're doing the job perfectly.

My problem is that i also want to access .txt file properties, but can't find out how to do it. I've used lots of things i've read, but none seems to be working. For txt files i just need to be able to get Creation Date and Modification Date (if possible, i would also like to be able to set Modification Date)

Any ideas?

Upvotes: 0

Views: 2456

Answers (1)

Michael Borgwardt
Michael Borgwardt

Reputation: 346347

Text files have no metadata other than that present for all files, which is accessible via java.io.File. However, that only gives you access (read and write) to the modification date, probably because not all filesystems have a separate creation date.

Upvotes: 1

Related Questions