ehatcher 2002/06/18 18:21:04
Modified: src/main/org/apache/tools/ant/taskdefs Tag: ANT_15_BRANCH
Dirname.java
Log:
doc'ed and reformatted with 4 space indents.
Revision Changes Path
No revision
No revision
1.2.2.1 +33 -26
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Dirname.java
Index: Dirname.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Dirname.java,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- Dirname.java 10 Apr 2002 13:47:46 -0000 1.2
+++ Dirname.java 19 Jun 2002 01:21:03 -0000 1.2.2.1
@@ -55,6 +55,7 @@
package org.apache.tools.ant.taskdefs;
import java.io.File;
+
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
@@ -83,31 +84,37 @@
*/
public class Dirname extends Task {
- private File file;
- private String property;
+ private File file;
+ private String property;
- // The setter for the `file' attribute
- public void setFile(File file) {
- this.file = file;
- }
-
- // The setter for the `property' attribute
- public void setProperty(String property) {
- this.property = property ;
- }
-
-
- // The method executing the task
- public void execute() throws BuildException {
- if (property == null) {
- throw new BuildException("property attribute required", location);
- }
- if (file == null) {
- throw new BuildException("file attribute required", location);
- } else {
- String value = file.getParent();
- getProject().setNewProperty(property, value);
- }
- }
+ /**
+ * Path to take the dirname of.
+ * @param file
+ */
+ public void setFile(File file) {
+ this.file = file;
+ }
+
+ /**
+ * The name of the property to set.
+ * @param property
+ */
+ public void setProperty(String property) {
+ this.property = property;
+ }
+
+
+ // The method executing the task
+ public void execute() throws BuildException {
+ if (property == null) {
+ throw new BuildException("property attribute required",
location);
+ }
+ if (file == null) {
+ throw new BuildException("file attribute required", location);
+ } else {
+ String value = file.getParent();
+ getProject().setNewProperty(property, value);
+ }
+ }
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>