attribute from the three latest task additions. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273512 13f79535-47bb-0310-9956-ffa450edef68master
@@ -15,7 +15,7 @@ directories. Right now it has effect only under Windows. Each of the | |||||
4 possible permissions has its own attribute, matching the arguments | 4 possible permissions has its own attribute, matching the arguments | ||||
for the attrib command.</p> | 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> | using nested <code><fileset></code> elements.</p> | ||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
@@ -27,15 +27,10 @@ using nested <code><fileset></code> elements.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">file</td> | <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> | changed.</td> | ||||
<td valign="top" valign="middle">Yes or nested | |||||
<code><fileset></code> elements.</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">readonly</td> | <td valign="top">readonly</td> | ||||
@@ -15,7 +15,7 @@ directories. Right now it has effect only under Unix. The group | |||||
atribute is equivalent to the coresponding argument for the chgrp | atribute is equivalent to the coresponding argument for the chgrp | ||||
command.</p> | 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> | using nested <code><fileset></code> elements.</p> | ||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
@@ -27,13 +27,10 @@ using nested <code><fileset></code> elements.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">file</td> | <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> | ||||
<tr> | <tr> | ||||
<td valign="top">group</td> | <td valign="top">group</td> | ||||
@@ -15,7 +15,7 @@ directories. Right now it has effect only under Unix. The owner | |||||
atribute is equivalent to the coresponding argument for the chown | atribute is equivalent to the coresponding argument for the chown | ||||
command.</p> | 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> | using nested <code><fileset></code> elements.</p> | ||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
@@ -27,13 +27,10 @@ using nested <code><fileset></code> elements.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">file</td> | <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> | ||||
<tr> | <tr> | ||||
<td valign="top">owner</td> | <td valign="top">owner</td> | ||||
@@ -106,8 +106,7 @@ public class Chmod extends ExecuteOn { | |||||
*/ | */ | ||||
public void setFile(File src) { | public void setFile(File src) { | ||||
FileSet fs = new FileSet(); | FileSet fs = new FileSet(); | ||||
fs.setDir(new File(src.getParent())); | |||||
fs.createInclude().setName(src.getName()); | |||||
fs.setFile(src); | |||||
addFileset(fs); | addFileset(fs); | ||||
} | } | ||||
@@ -93,15 +93,7 @@ public abstract class AbstractAccessTask | |||||
public void setFile(File src) { | public void setFile(File src) { | ||||
FileSet fs = new FileSet(); | 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); | addFileset(fs); | ||||
} | } | ||||
@@ -65,8 +65,6 @@ | |||||
package org.apache.tools.ant.taskdefs.optional.unix; | package org.apache.tools.ant.taskdefs.optional.unix; | ||||
import java.io.File; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
/** | /** | ||||
@@ -67,6 +67,8 @@ import java.io.File; | |||||
* | * | ||||
* @author skanga@bigfoot.com | * @author skanga@bigfoot.com | ||||
* @author <a href="mailto:Jerome@jeromelacoste.com">Jerome Lacoste</a> | * @author <a href="mailto:Jerome@jeromelacoste.com">Jerome Lacoste</a> | ||||
* | |||||
* @since Ant 1.6 | |||||
*/ | */ | ||||
public class Attrib extends ExecuteOn { | public class Attrib extends ExecuteOn { | ||||
@@ -86,15 +88,7 @@ public class Attrib extends ExecuteOn { | |||||
public void setFile(File src) { | public void setFile(File src) { | ||||
FileSet fs = new FileSet(); | 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); | addFileset(fs); | ||||
} | } | ||||