ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <>
Subject Re: [signjar] prevent double signing
Date Wed, 03 Nov 2004 14:48:27 GMT
to get the file modified date you can use something
like this:

     <scriptdef name="getlm" language="javascript">
         <attribute name="file"/>
         <attribute name="property"/>
             fileName = attributes.get("file");
             propName = attributes.get("property");
             file = new;
             last = file.lastModified();
             project.setNewProperty(propName, last);
     <getlm file="files.xml"
     <echo>buildfile is last modified at

The above build script defines getlm script def which 
retrives the modification date via javascript ans sets
a new property with the size. Mind that
file.lastModified() returns long number so you should
parse it to a Date to suit your needs.

I borrowed the above script from a previous thread in
ant's mailing list called Ant Get FileSize using
exec?. You can see it for the original source.

HTH Ivan
--- T E Schmitz <> wrote:

> Hello,
> I am using the signjar task to sign a set of jar
> files for a WebStart 
> application. Some of the jars have already been
> signed by Sun (e.g. 
> mail.jar) and as a jar mustn't have more than one
> signature I need to 
> exclude those files from being signed.
> I misunderstood and tried the "lazy" attribute but
> it only prevents 
> re-signing with the same signature.
> a) Is there a means of determining which jars are
> signed with the 
> purpose of building an exclude list?
> b) I would like the signed jar to bear the same
> modification date as the 
> original. I can't see any means of obtaining a
> file's modification date 
> in order to touch the new file with it.
> Thanks in advance for any ideas.
> -- 
> Regards/Gruß,
> Tarlika Elisabeth Schmitz
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Do you Yahoo!? 
Check out the new Yahoo! Front Page. 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message