ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KC Baltz <KBa...@responsenetworks.com>
Subject RE: newbie question - how does contribution work
Date Tue, 15 Aug 2000 15:00:46 GMT
I think it'd be a useful addition.  My only suggestion would be change the
parameter name to "forceoverwrite" so it matches the similar parameter in
<copydir>.

K.C.

> -----Original Message-----
> From: uli stehling [mailto:uliian@netscape.net]
> Sent: Tuesday, August 15, 2000 12:55 PM
> To: ant-dev@jakarta.apache.org
> Subject: newbie question - how does contribution work
> 
> 
> Hello!
> 
> Due to problems with different clocks on different servers I 
> changed the
> Copyfile class to implement an overwrite function (which 
> already existed in
> the Project class).
> 
> My questions:
> 1 is anyone interested in this overwrite funcionality
> 2 if yes how would it be implemented into the cvs
> 
> Regards
> 
> uli
> 
> PS the new code:
> 
> public class Copyfile extends Task {
> 
>     private File srcFile;
>     private File destFile;
>     private boolean filtering = false;
>     private boolean overwriteFlag = false;
> 
>     public void setSrc(String src) {
>         srcFile = project.resolveFile(src);
>     }
> 
>     public void setDest(String dest) {
>         destFile = project.resolveFile(dest);
>     }
> 
>     public void setFiltering(String filter) {
>         filtering = Project.toBoolean(filter);
>     }
> 
> 	public void setOverwrite(String overwrite) {
> 		overwriteFlag = Project.toBoolean(overwrite);
> 	}
> 
>     public void execute() throws BuildException {
> 		try {
> 			project.copyFile(srcFile, destFile, 
> filtering, overwriteFlag);
> 		} catch (IOException ioe) {
> 			String msg = "Error copying file: " + 
> srcFile.getAbsolutePath()
> 				+ " due to " + ioe.getMessage();
> 			throw new BuildException(msg);
> 		}
> 	}
> }
> 
> PPS I have tested it and it seems to work fine on version 1.1
> 
> 
> ____________________________________________________________________
> Get your own FREE, personal Netscape WebMail account today at 
http://webmail.netscape.com.

Mime
View raw message