Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs

public Class Chmod

extends ExecuteOn
Class Inheritance
Imports
java.io.File, .IOException, org.apache.tools.ant.BuildException, .Project, org.apache.tools.ant.taskdefs.condition.Os, org.apache.tools.ant.types.Commandline, .FileSet, .PatternSet

Chmod equivalent for unix-like environments.
Since
Ant 1.1

Field Summary

Modifier and TypeField and Description
private FileSet
private boolean
private boolean
Inherited from org.apache.tools.ant.taskdefs.ExecuteOn:
destDirfilesetsmappermapperElementsrcFilePossrcIsFirsttargetFilePostype

Constructor Summary

AccessConstructor and Description
public
Chmod()

Chmod task for setting file and directory permissions.

Method Summary

Modifier and TypeMethod and Description
protected void
checkConfiguration()

Overrides org.apache.tools.ant.taskdefs.ExecuteOn.checkConfiguration.

Check the attributes and nested elements.
public PatternSet.NameEntry

Returns:

a nameentry to be configured.
createExclude
()

Add a name entry on the exclude list.

public PatternSet.NameEntry

Returns:

a NameEntry to be configured.
createInclude
()

Add a name entry on the include list.

public PatternSet

Returns:

a patternset to be configured.
createPatternSet
()

Add a set of patterns.

public void
execute()

Overrides org.apache.tools.ant.taskdefs.ExecTask.execute.

Carry out the chmoding.
protected boolean

Returns:

true if the os is valid.
isValidOs
()

Overrides org.apache.tools.ant.taskdefs.ExecTask.isValidOs.

Check if the os is valid.
public void
setAddsourcefile(boolean
ignored.
b
)

Overrides org.apache.tools.ant.taskdefs.ExecuteOn.setAddsourcefile.

This is not allowed for Chmod.
public void
public void
setDefaultexcludes(boolean
"true"|"on"|"yes" when default exclusions should be used, "false"|"off"|"no" when they shouldn't be used.
useDefaultExcludes
)

Sets whether default exclusions should be used or not.

public void
setDir(File
the directory.
src
)

Overrides org.apache.tools.ant.taskdefs.ExecTask.setDir.

The directory which holds the files whose permissions must be changed.
public void
setExcludes(String
the string containing the exclude patterns.
excludes
)

Sets the set of exclude patterns.

public void
public void
setFile(File
the source file or directory.
src
)

The file or single directory of which the permissions must be changed.

public void
setIncludes(String
the string containing the include patterns.
includes
)

Sets the set of include patterns.

public void
setPerm(String
the new permissions.
perm
)

Set the new permissions.

public void
setProject(Project
the project for this task.
project
)

Overrides org.apache.tools.ant.ProjectComponent.setProject.

Set the project of this task.
public void
setSkipEmptyFilesets(boolean
ignored.
skip
)

Overrides org.apache.tools.ant.taskdefs.ExecuteOn.setSkipEmptyFilesets.

This is not allowed for Chmod.
Inherited from org.apache.tools.ant.taskdefs.ExecuteOn:
addaddaddDirsetaddFilelistaddFilesetcreateHandlercreateMappercreateSrcfilecreateTargetfilegetCommandlinegetCommandlinegetDirsgetFilesgetFilesAndDirsrunExecrunParallelsetDestsetForcesetForwardslashsetIgnoremissingsetMaxParallelsetParallelsetRelativesetTypesetupRedirectorsetVerbose

Field Detail

defaultSetback to summary
private FileSet defaultSet
defaultSetDefinedback to summary
private boolean defaultSetDefined
havePermback to summary
private boolean havePerm

Constructor Detail

Chmodback to summary
public Chmod()

Chmod task for setting file and directory permissions.

Method Detail

checkConfigurationback to summary
protected void checkConfiguration()

Overrides org.apache.tools.ant.taskdefs.ExecuteOn.checkConfiguration.

Check the attributes and nested elements.

Annotations
@Override
createExcludeback to summary
public PatternSet.NameEntry createExclude()

Add a name entry on the exclude list.

Returns:PatternSet.NameEntry

a nameentry to be configured.

createIncludeback to summary
public PatternSet.NameEntry createInclude()

Add a name entry on the include list.

Returns:PatternSet.NameEntry

a NameEntry to be configured.

createPatternSetback to summary
public PatternSet createPatternSet()

Add a set of patterns.

Returns:PatternSet

a patternset to be configured.

executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.taskdefs.ExecTask.execute.

Carry out the chmoding.

Annotations
@Override
Exceptions
BuildException:
on error.
isValidOsback to summary
protected boolean isValidOs()

Overrides org.apache.tools.ant.taskdefs.ExecTask.isValidOs.

Check if the os is valid. Always include unix.

Returns:boolean

true if the os is valid.

Annotations
@Override
setAddsourcefileback to summary
public void setAddsourcefile(boolean b)

Overrides org.apache.tools.ant.taskdefs.ExecuteOn.setAddsourcefile.

This is not allowed for Chmod.

Parameters
b:boolean

ignored.

Annotations
@Override
Exceptions
BuildException:
always.
setCommandback to summary
public void setCommand(Commandline cmdl)

Overrides org.apache.tools.ant.taskdefs.ExecTask.setCommand.

Set the command. This is not allowed for Chmod.

Parameters
cmdl:Commandline

ignored.

Annotations
@Override
Exceptions
BuildException:
always.
setDefaultexcludesback to summary
public void setDefaultexcludes(boolean useDefaultExcludes)

Sets whether default exclusions should be used or not.

Parameters
useDefaultExcludes:boolean

"true"|"on"|"yes" when default exclusions should be used, "false"|"off"|"no" when they shouldn't be used.

setDirback to summary
public void setDir(File src)

Overrides org.apache.tools.ant.taskdefs.ExecTask.setDir.

The directory which holds the files whose permissions must be changed.

Parameters
src:File

the directory.

Annotations
@Override
setExcludesback to summary
public void setExcludes(String excludes)

Sets the set of exclude patterns. Patterns may be separated by a comma or a space.

Parameters
excludes:String

the string containing the exclude patterns.

setExecutableback to summary
public void setExecutable(String e)

Overrides org.apache.tools.ant.taskdefs.ExecTask.setExecutable.

Set the executable. This is not allowed for Chmod.

Parameters
e:String

ignored.

Annotations
@Override
Exceptions
BuildException:
always.
setFileback to summary
public void setFile(File src)

The file or single directory of which the permissions must be changed.

Parameters
src:File

the source file or directory.

setIncludesback to summary
public void setIncludes(String includes)

Sets the set of include patterns. Patterns may be separated by a comma or a space.

Parameters
includes:String

the string containing the include patterns.

setPermback to summary
public void setPerm(String perm)

Set the new permissions.

Parameters
perm:String

the new permissions.

setProjectback to summary
public void setProject(Project project)

Overrides org.apache.tools.ant.ProjectComponent.setProject.

Set the project of this task. Calls the super class and sets the project on dhe default FileSet.

Parameters
project:Project

the project for this task.

Annotations
@Override
See Also
org.apache.tools.ant.ProjectComponent#setProject
setSkipEmptyFilesetsback to summary
public void setSkipEmptyFilesets(boolean skip)

Overrides org.apache.tools.ant.taskdefs.ExecuteOn.setSkipEmptyFilesets.

This is not allowed for Chmod.

Parameters
skip:boolean

ignored.

Annotations
@Override
Exceptions
BuildException:
always.