dcsimg
How to find the file creation date?!!
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   riswan_babu
Posted On:   Wednesday, June 4, 2008 02:40 AM

I'm using "org.apache.myfaces.custom.fileupload.UploadedFile"
in backing bean to read the excel file.

I need to find the creation date of the excel file for validation.

How to find the creation date of the file?



Thanks..

Re: How to find the file creation date?!!

Posted By:   Stephen_McConnell  
Posted On:   Wednesday, June 4, 2008 10:35 AM

You can find the "last modified" date using the File object, but this is probably not what you want... and you also want to know it before you upload it.


I found a discussion on the Sun site about Getting the Creation Date in Java. But what it mainly says is that it is not part of the Java File API and you probably need to use JNI to do this.


The only possibility might be to embed the file creation date in the file name.... I often do this for my excel files and word documents for my own record keeping.... but it would require trusting that someone else is following your protocol.


See what you can make out of the above forum link. I also found a good article on manipulating File attributes Files and Directories: Java Glossary. You can be sure it's now book marked in my browser....


Hope this helps... and if anyone else has found a solution, please post here...


Stephen McConnell

About | Sitemap | Contact