Methods Summary |
---|
protected void | checkConfiguration()Check the attributes and nested elements.
if (!havePerm) {
throw new BuildException("Required attribute perm not set in chmod",
getLocation());
}
if (defaultSetDefined && defaultSet.getDir(getProject()) != null) {
addFileset(defaultSet);
}
super.checkConfiguration();
|
public PatternSet.NameEntry | createExclude()Add a name entry on the exclude list.
defaultSetDefined = true;
return defaultSet.createExclude();
|
public PatternSet.NameEntry | createInclude()Add a name entry on the include list.
defaultSetDefined = true;
return defaultSet.createInclude();
|
public org.apache.tools.ant.types.PatternSet | createPatternSet()Add a set of patterns.
defaultSetDefined = true;
return defaultSet.createPatternSet();
|
public void | execute()Carry out the chmoding.
/*
* In Ant 1.1, <chmod dir="foo" /> means, change the permissions
* of directory foo, not anything inside of it. This is the case the
* second branch of the if statement below catches for backwards
* compatibility.
*/
if (defaultSetDefined || defaultSet.getDir(getProject()) == null) {
try {
super.execute();
} finally {
if (defaultSetDefined && defaultSet.getDir(getProject()) != null) {
filesets.removeElement(defaultSet);
}
}
} else if (isValidOs()) {
// we are chmodding the given directory
Execute execute = prepareExec();
Commandline cloned = (Commandline) cmdl.clone();
cloned.createArgument().setValue(defaultSet.getDir(getProject())
.getPath());
try {
execute.setCommandline(cloned.getCommandline());
runExecute(execute);
} catch (IOException e) {
throw new BuildException("Execute failed: " + e, e, getLocation());
} finally {
// close the output file if required
logFlush();
}
}
|
protected boolean | isValidOs()Check if the os is valid.
Always include unix.
return Os.isFamily(Os.FAMILY_UNIX) && super.isValidOs();
|
public void | setAddsourcefile(boolean b)This is not allowed for Chmod.
throw new BuildException(getTaskType()
+ " doesn\'t support the addsourcefile attribute", getLocation());
|
public void | setCommand(org.apache.tools.ant.types.Commandline cmdl)Set the command.
This is not allowed for Chmod.
throw new BuildException(getTaskType()
+ " doesn\'t support the command attribute", getLocation());
|
public void | setDefaultexcludes(boolean useDefaultExcludes)Sets whether default exclusions should be used or not.
defaultSetDefined = true;
defaultSet.setDefaultexcludes(useDefaultExcludes);
|
public void | setDir(java.io.File src)The directory which holds the files whose permissions must be changed.
defaultSet.setDir(src);
|
public void | setExcludes(java.lang.String excludes)Sets the set of exclude patterns. Patterns may be separated by a comma
or a space.
defaultSetDefined = true;
defaultSet.setExcludes(excludes);
|
public void | setExecutable(java.lang.String e)Set the executable.
This is not allowed for Chmod.
throw new BuildException(getTaskType()
+ " doesn\'t support the executable attribute", getLocation());
|
public void | setFile(java.io.File src)The file or single directory of which the permissions must be changed.
FileSet fs = new FileSet();
fs.setFile(src);
addFileset(fs);
|
public void | setIncludes(java.lang.String includes)Sets the set of include patterns. Patterns may be separated by a comma
or a space.
defaultSetDefined = true;
defaultSet.setIncludes(includes);
|
public void | setPerm(java.lang.String perm)Set the new permissions.
createArg().setValue(perm);
havePerm = true;
|
public void | setProject(org.apache.tools.ant.Project project)Set the project of this task.
Calls the super class and sets the project on dhe default FileSet.
super.setProject(project);
defaultSet.setProject(project);
|
public void | setSkipEmptyFilesets(boolean skip)This is not allowed for Chmod.
throw new BuildException(getTaskType()
+ " doesn\'t support the skipemptyfileset attribute", getLocation());
|