KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > antmod > tasks > FileName


1 package org.antmod.tasks;
2
3 import java.io.File JavaDoc;
4
5 import org.apache.tools.ant.BuildException;
6 import org.apache.tools.ant.Project;
7 import org.apache.tools.ant.taskdefs.Ant;
8
9 /**
10  * @deprecated Use Ant's standard "basename" task instead of this one!!!
11  * This class only exists such that old buildfiles can still work.
12  *
13  * @author Klaas Waslander
14  */

15 public class FileName extends Ant {
16
17     private String JavaDoc file;
18     private String JavaDoc property;
19
20     public FileName() {
21     }
22
23     public void setFile(String JavaDoc file) {
24         this.file = file;
25     }
26
27     public void setProperty(String JavaDoc property) {
28         this.property = property;
29     }
30
31     public void execute() throws BuildException {
32         File JavaDoc theFile = new File JavaDoc(this.file);
33         getProject().setProperty(this.property, theFile.getName());
34     }
35 }
36
Popular Tags