ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Klaasen" <Tom.Klaa...@the-ecorp.com>
Subject RE: Last modified of copied files
Date Tue, 10 Oct 2000 13:07:59 GMT
Out of curiosity: will this compile on a jdk1.1? I could imagine that it
won't (some error message like "method setLastModified(long) not found in
class java.io.File" comes to mind)

tomK

> -----Original Message-----
> From: Ernst de Haan [mailto:ernst@jollem.com]
> Sent: dinsdag 10 oktober 2000 14:53
> To: ant-dev@jakarta.apache.org
> Subject: Re: Last modified of copied files
> 
> 
> The code can be made conditional so it will only execute on 
> 1.2+ systems.
> There are different solutions, the following is one of them:
> 
>    boolean jdk12;
>    try {
>       Class.forName("java.lang.Comparable");
>       jdk12 = true;
>    } catch (ClassNotFoundException e) {
>       jdk12 = false;
>    }
> 
>    if (jdk12) {
>       destFile.setLastModified(sourceFile.lastModified());
>    }
> 
> I suggest the JDK 1.2+ checking is done in a central place, 
> like Project.
> 
> 
> Ernst
> 
> Matthew Kuperus Heun wrote:
> > Greetings:
> > 
> > >I solved this by adding the following code to Project.java 
> on line 656:
> > >
> > >destFile.setLastModified(sourceFile.lastModified());
> > >
> > >I'm affraid this isn't Java 1.1 compatible, is this a problem?
> > 
> > Yes, for those of us on a Macintosh who don't have access to jdk1.2 
> > yet.  (Will have it when OSX hits the streets.)  What is 
> the general 
> > policy for ANT wrt jdk1.2?
> > 
> > Cheers,
> > 
> > Matt
> > -- 
> > 
> > 
> > --
> > 
> > Matthew Kuperus Heun
> > Global Aerospace Corporation
> > +1 (978) 922-7115 (voice & fax)
> > <http://www.gaerospace.com>
> > <mailto:matthew.k.heun@gaerospace.com>
> > 
> 

Mime
View raw message