bodewig 2002/11/08 00:32:13
Modified: docs/manual/OptionalTasks attrib.html chgrp.html chown.html
src/main/org/apache/tools/ant/taskdefs Chmod.java
src/main/org/apache/tools/ant/taskdefs/optional/unix
AbstractAccessTask.java Chown.java
src/main/org/apache/tools/ant/taskdefs/optional/windows
Attrib.java
Log:
Simplify a few methods by using FileSet#setFile, remove redundant dir
attribute from the three latest task additions.
Revision Changes Path
1.2 +4 -9 jakarta-ant/docs/manual/OptionalTasks/attrib.html
Index: attrib.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/OptionalTasks/attrib.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- attrib.html 7 Nov 2002 16:26:18 -0000 1.1
+++ attrib.html 8 Nov 2002 08:32:13 -0000 1.2
@@ -15,7 +15,7 @@
4 possible permissions has its own attribute, matching the arguments
for the attrib command.</p>
-<p><a href="../CoreTypes/fileset.html">FileSet</a> can be specified
+<p><a href="../CoreTypes/fileset.html">FileSet</a>s can be specified
using nested <code><fileset></code> elements.</p>
<h3>Parameters</h3>
@@ -27,15 +27,10 @@
</tr>
<tr>
<td valign="top">file</td>
- <td valign="top">the file of which the permissions must be
- changed.</td>
- <td valign="top" valign="middle" rowspan="2">one of the two or
- nested <code><fileset></code> elements.</td>
- </tr>
- <tr>
- <td valign="top">dir</td>
- <td valign="top">the directory whose permissions must be
+ <td valign="top">the file or directory of which the permissions must be
changed.</td>
+ <td valign="top" valign="middle">Yes or nested
+ <code><fileset></code> elements.</td>
</tr>
<tr>
<td valign="top">readonly</td>
1.2 +5 -8 jakarta-ant/docs/manual/OptionalTasks/chgrp.html
Index: chgrp.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/OptionalTasks/chgrp.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- chgrp.html 7 Nov 2002 15:59:47 -0000 1.1
+++ chgrp.html 8 Nov 2002 08:32:13 -0000 1.2
@@ -15,7 +15,7 @@
atribute is equivalent to the coresponding argument for the chgrp
command.</p>
-<p><a href="../CoreTypes/fileset.html">FileSet</a> can be specified
+<p><a href="../CoreTypes/fileset.html">FileSet</a>s can be specified
using nested <code><fileset></code> elements.</p>
<h3>Parameters</h3>
@@ -27,13 +27,10 @@
</tr>
<tr>
<td valign="top">file</td>
- <td valign="top">the file of which the group must be changed.</td>
- <td valign="top" valign="middle" rowspan="2">one of the two or
- nested <code><fileset></code> elements.</td>
- </tr>
- <tr>
- <td valign="top">dir</td>
- <td valign="top">the directory whose group must be changed.</td>
+ <td valign="top">the file or directory of which the group must be
+ changed.</td>
+ <td valign="top" valign="middle">Yes or nested
+ <code><fileset></code> elements.</td>
</tr>
<tr>
<td valign="top">group</td>
1.2 +5 -8 jakarta-ant/docs/manual/OptionalTasks/chown.html
Index: chown.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/OptionalTasks/chown.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- chown.html 7 Nov 2002 15:59:47 -0000 1.1
+++ chown.html 8 Nov 2002 08:32:13 -0000 1.2
@@ -15,7 +15,7 @@
atribute is equivalent to the coresponding argument for the chown
command.</p>
-<p><a href="../CoreTypes/fileset.html">FileSet</a> can be specified
+<p><a href="../CoreTypes/fileset.html">FileSet</a>s can be specified
using nested <code><fileset></code> elements.</p>
<h3>Parameters</h3>
@@ -27,13 +27,10 @@
</tr>
<tr>
<td valign="top">file</td>
- <td valign="top">the file of which the owner must be changed.</td>
- <td valign="top" valign="middle" rowspan="2">one of the two or
- nested <code><fileset></code> elements.</td>
- </tr>
- <tr>
- <td valign="top">dir</td>
- <td valign="top">the directory of which the owner must be changed.</td>
+ <td valign="top">the file or directory of which the owner must be
+ changed.</td>
+ <td valign="top" valign="middle">Yes or nested
+ <code><fileset></code> elements.</td>
</tr>
<tr>
<td valign="top">owner</td>
1.33 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Chmod.java
Index: Chmod.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Chmod.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- Chmod.java 25 Jul 2002 15:21:04 -0000 1.32
+++ Chmod.java 8 Nov 2002 08:32:13 -0000 1.33
@@ -106,8 +106,7 @@
*/
public void setFile(File src) {
FileSet fs = new FileSet();
- fs.setDir(new File(src.getParent()));
- fs.createInclude().setName(src.getName());
+ fs.setFile(src);
addFileset(fs);
}
1.2 +1 -9
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/unix/AbstractAccessTask.java
Index: AbstractAccessTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/unix/AbstractAccessTask.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractAccessTask.java 7 Nov 2002 15:59:47 -0000 1.1
+++ AbstractAccessTask.java 8 Nov 2002 08:32:13 -0000 1.2
@@ -93,15 +93,7 @@
public void setFile(File src) {
FileSet fs = new FileSet();
- fs.setDir(new File(src.getParent()));
- fs.createInclude().setName(src.getName());
- addFileset(fs);
- }
-
- public void setDir(File src) {
- FileSet fs = new FileSet();
- fs.setDir(new File(src.getParent()));
- fs.createInclude().setName(src.getName());
+ fs.setFile(src);
addFileset(fs);
}
1.2 +0 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/unix/Chown.java
Index: Chown.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/unix/Chown.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Chown.java 7 Nov 2002 15:59:47 -0000 1.1
+++ Chown.java 8 Nov 2002 08:32:13 -0000 1.2
@@ -65,8 +65,6 @@
package org.apache.tools.ant.taskdefs.optional.unix;
-import java.io.File;
-
import org.apache.tools.ant.BuildException;
/**
1.2 +3 -9
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/windows/Attrib.java
Index: Attrib.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/windows/Attrib.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Attrib.java 7 Nov 2002 16:26:18 -0000 1.1
+++ Attrib.java 8 Nov 2002 08:32:13 -0000 1.2
@@ -67,6 +67,8 @@
*
* @author [EMAIL PROTECTED]
* @author <a href="mailto:[EMAIL PROTECTED]">Jerome Lacoste</a>
+ *
+ * @since Ant 1.6
*/
public class Attrib extends ExecuteOn {
@@ -86,15 +88,7 @@
public void setFile(File src) {
FileSet fs = new FileSet();
- fs.setDir(new File(src.getParent()));
- fs.createInclude().setName(src.getName());
- addFileset(fs);
- }
-
- public void setDir(File src) {
- FileSet fs = new FileSet();
- fs.setDir(new File(src.getParent()));
- fs.createInclude().setName(src.getName());
+ fs.setFile(src);
addFileset(fs);
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>