ant-user mailing list archives

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

<project>
 
     <scriptdef name="getlm" language="javascript">
         <attribute name="file"/>
         <attribute name="property"/>
         <![CDATA[
             fileName = attributes.get("file");
             propName = attributes.get("property");
 
             file = new java.io.File(fileName);
             last = file.lastModified();
             
             project.setNewProperty(propName, last);
         ]]>
     </scriptdef>
 
     <getlm file="files.xml"
property="buildfile.last"/>
     <echo>buildfile is last modified at
${buildfile.last}</echo>
 
</project>

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 <mailreg@numerixtechnology.de> 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:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message