I'm developing a Java library and I'm tryi开发者_Python百科ng to define a good Header through JAutoDoc.
It works fine but I can't figure out how to automatically define the creation date of the file. There is a variable called date but it returns the current date, not the creation date of the file. If I will use that variable I will have all the Header with the same date.
Does anyone know a solution for this issue?
Thanks, Luca
I don't think that you might find a way to get the creation time of a file in an automated way. Of course most operating systems offer different timestamps (created, accessed, modified), but it may not be easy to get this information.
More problematic is the following: If you use some kind of SCM system for your code like git or svn, and you (or some other person collaborating on this project) check out a fresh version of your code, then the files will have a creation time that is the same as the checkout time and not the time when you originally created the checked in file.
So in this scenario you cannot automatically get the creation time of your file for javadoc.
What I'd suggest is that you define a template for new files in your IDE which inserts on creation the actual time as a part of the file's javadoc and that is not changed later.
精彩评论