ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 47373] patch to support setting last modified date
Date Fri, 19 Jun 2009 17:48:49 GMT

--- Comment #11 from Mark Farnsworth <>  2009-06-19 10:48:44
PST ---
I will look at TAR and add the changes to my patch if we are going forward with
this.  I will also make sure that the code changes are covered by unit tests
and that the docs are appropriately updated.

I am also open to ideas on syntax.

I was thinking of calling the attribute "lastmodified" and allowing the user to
set it with any value that can be parsed via the standard java date format
instance.  If the property is set it would control the output.  Ommiting the
property, setting to empty string, or using "auto" would produce the current

lastmodified="2009-06-19 01:36 PM"

The following is pseudo code for the prop include the options for supporting
"auto".  I have not done ANT coding in the past so bear with me a bit.  I will
format and document all the code in the next patch update as per the exiting
ANT standards page on the wiki.

public void setLastModified(final String dateString) {
  lastModifedSet = false;
  if(dateString.equals("")) return;
  if(dateString.equals("default")) return;
  try {
    lastModifed = DateFormat.getInstance().parse(dateString).getTime();
    lastModifedSet = true;
  } catch (final ParseException e) {
    throw new RuntimeException(e);

We could change the terms if someone has a better idea then the using
"lastmodified".  I notice that ANT often uses shorter names (i.e. destfile). 
We could use "modified" or we could use "contentdate".   

The parsing of the date string respects the local where ANT is running.  I
think that is a good thing but others might want it to force support for a
given style of dates.  I am neutral on the issue.

Taking the patch from where it is to completion will be a little bit of work. 
I am happy to do the grunt if someone assures me that they will review the
feature and that it has at least a reasonable chance of making the cut for the
next release.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message