Take a peak at http://jakarta.apache.org/guidelines/source.html for
instructions on how to submit a patch to the group. �If the commitors
aren't too busy, they usually give a response in a couple of days.
One word of warning. �If your email gateway has a lovely habit of trying to
wrap all your lines to 70 odd characters or less, (gotta love lotus notes)
it can mess up your patch. �In that case, include the patch as an
attachement.
Glenn McAllister
TID - Software Developer - VisualAge for Java
IBM Toronto Lab, (416) 448-3805
"An approximate answer to the right question is better than the
right answer to the wrong question." - John W. Tukey
Please respond to [EMAIL PROTECTED]
To: � � � [EMAIL PROTECTED]
cc:
Subject: � � � �Re: [RE: newbie question - how does contribution work]
KC Baltz <[EMAIL PROTECTED]> wrote:
> 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.
Thanks for the tip - I did the changes to the code.
How does it work from now on?
If I understood it the right way, now a committer would have to include my
code or decide not to do it...
Anyway here it is:
regards
uli stehling
package org.apache.tools.ant.taskdefs;
import org.apache.tools.ant.*;
import java.io.*;
import java.util.*;
public class Copyfile extends Task {
� � private File srcFile;
� �private File destFile;
� �private boolean filtering = false;
� �private boolean forceOverwrite = 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 setForceoverwrite(String force) {
� � � � � � � �forceOverwrite = Project.toBoolean(force);
� �}
� � public void execute() throws BuildException {(force);ave
� � � � � � � �if (forceOverwrite ||
� � � � � � � �(srcFile.lastModified() > destFile.lastModified())) {
� � � � � � � � � � � �try {
� � � � � � � � � � � � � � � �project.copyFile(srcFile, destFile,
filtering, forceOverwrite);
� � � � � � � � � � � �} catch (IOException ioe) {
� � � � � � � � � � � � � � � �String msg = "Error copying file: " +
srcFile.getAbsolutePath()
� � � � � � � � � � � � � � � � � � � �+ " due to " + ioe.getMessage();
� � � � � � � � � � � � � � � �throw new BuildException(msg);
� � � � � � � � � � � �}
� � � � � � � �}
� � � �}
}
____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at
http://webmail.netscape.com.