KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > kawa > ant > XCopy


1 package gnu.kawa.ant;
2
3 import org.apache.tools.ant.taskdefs.Copy;
4
5 import org.apache.tools.ant.BuildException;
6
7 public class XCopy extends Copy
8 {
9    private boolean dataOnly = false;
10    
11    public XCopy()
12    {
13    }
14    
15    public LineStripperSet createLineStripperSet()
16    {
17       LineStripperSet stripper = new LineStripperSet();
18       getFilterSets().addElement(stripper);
19       return stripper;
20    }
21    
22    public LineCommenterSet createLineCommenterSet()
23    {
24       LineCommenterSet stripper = new LineCommenterSet();
25       getFilterSets().addElement(stripper);
26       return stripper;
27    }
28    
29    public void setDataOnly(final boolean f)
30    {
31       dataOnly = f;
32    }
33    
34    public boolean isDataOnly()
35    {
36       return dataOnly;
37    }
38
39     /**
40      * Performs the copy operation.
41      * Support dataOnly attribute which makes this task a no-op if true.
42      */

43     public void execute()
44         throws BuildException
45     {
46         if (isDataOnly())
47             return;
48         
49         super.execute();
50     }
51 }
52
Popular Tags