01: package gnu.kawa.ant;
02:
03: import org.apache.tools.ant.taskdefs.Copy;
04:
05: import org.apache.tools.ant.BuildException;
06:
07: public class XCopy extends Copy {
08: private boolean dataOnly = false;
09:
10: public XCopy() {
11: }
12:
13: public LineStripperSet createLineStripperSet() {
14: LineStripperSet stripper = new LineStripperSet();
15: getFilterSets().addElement(stripper);
16: return stripper;
17: }
18:
19: public LineCommenterSet createLineCommenterSet() {
20: LineCommenterSet stripper = new LineCommenterSet();
21: getFilterSets().addElement(stripper);
22: return stripper;
23: }
24:
25: public void setDataOnly(final boolean f) {
26: dataOnly = f;
27: }
28:
29: public boolean isDataOnly() {
30: return dataOnly;
31: }
32:
33: /**
34: * Performs the copy operation.
35: * Support dataOnly attribute which makes this task a no-op if true.
36: */
37: public void execute() throws BuildException {
38: if (isDataOnly())
39: return;
40:
41: super.execute();
42: }
43: }
|