org.apache.tools.ant.taskdefs

Class Chmod


public class Chmod
extends ExecuteOn

Chmod equivalent for unix-like environments.
Since:
Ant 1.1
To do:
Refactor so it does not extend from ExecuteOn and then turn around and unsupport several attributes.

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.tools.ant.taskdefs.ExecuteOn

ExecuteOn.FileDirBoth

Field Summary

Fields inherited from class org.apache.tools.ant.taskdefs.ExecuteOn

destDir, filesets, mapper, mapperElement, srcFilePos, srcIsFirst, targetFilePos, type

Fields inherited from class org.apache.tools.ant.taskdefs.ExecTask

cmdl, failOnError, newEnvironment, redirector, redirectorElement

Fields inherited from class org.apache.tools.ant.Task

description, location, target, taskName, taskType, wrapper

Fields inherited from class org.apache.tools.ant.ProjectComponent

project

Constructor Summary

Chmod()
Chmod task for setting file and directory permissions.

Method Summary

protected void
checkConfiguration()
PatternSet.NameEntry
createExclude()
Add a name entry on the exclude list.
PatternSet.NameEntry
createInclude()
Add a name entry on the include list.
PatternSet
createPatternSet()
Add a set of patterns.
void
execute()
Called by the project to let the task do its work.
protected boolean
isValidOs()
void
setAddsourcefile(boolean b)
void
setCommand(Commandline cmdl)
void
setDefaultexcludes(boolean useDefaultExcludes)
Sets whether default exclusions should be used or not.
void
setDir(File src)
The directory which holds the files whose permissions must be changed.
void
setExcludes(String excludes)
Sets the set of exclude patterns.
void
setExecutable(String e)
void
setFile(File src)
The file or single directory of which the permissions must be changed.
void
setIncludes(String includes)
Sets the set of include patterns.
void
setPerm(String perm)
The new permissions.
void
setProject(Project project)
void
setSkipEmptyFilesets(boolean skip)

Methods inherited from class org.apache.tools.ant.taskdefs.ExecuteOn

add, addDirset, addFilelist, addFileset, checkConfiguration, createHandler, createMapper, createSrcfile, createTargetfile, getCommandline, getCommandline, getDirs, getFiles, getFilesAndDirs, runExec, runParallel, setAddsourcefile, setDest, setForce, setForwardslash, setIgnoremissing, setMaxParallel, setParallel, setRelative, setSkipEmptyFilesets, setType, setVerbose, setupRedirector

Methods inherited from class org.apache.tools.ant.taskdefs.ExecTask

addConfiguredRedirector, addEnv, checkConfiguration, createArg, createHandler, createWatchdog, execute, getResolveExecutable, isValidOs, logFlush, maybeSetResultPropertyValue, prepareExec, resolveExecutable, runExec, runExecute, setAppend, setCommand, setDir, setError, setErrorProperty, setExecutable, setFailIfExecutionFails, setFailonerror, setInput, setInputString, setLogError, setNewenvironment, setOs, setOutput, setOutputproperty, setResolveExecutable, setResultProperty, setSearchPath, setSpawn, setTimeout, setTimeout, setVMLauncher, setupRedirector

Methods inherited from class org.apache.tools.ant.Task

execute, getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

Methods inherited from class org.apache.tools.ant.ProjectComponent

getProject, log, log, setProject

Constructor Details

Chmod

public Chmod()
Chmod task for setting file and directory permissions.

Method Details

checkConfiguration

protected void checkConfiguration()
Overrides:
checkConfiguration in interface ExecuteOn

createExclude

public PatternSet.NameEntry createExclude()
Add a name entry on the exclude list.

createInclude

public PatternSet.NameEntry createInclude()
Add a name entry on the include list.

createPatternSet

public PatternSet createPatternSet()
Add a set of patterns.

execute

public void execute()
            throws BuildException
Called by the project to let the task do its work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running "ant target1 target2" will run all tasks in target3 twice.
Overrides:
execute in interface ExecTask
Throws:
BuildException - if something goes wrong with the build

isValidOs

protected boolean isValidOs()
Overrides:
isValidOs in interface ExecTask

setAddsourcefile

public void setAddsourcefile(boolean b)
Overrides:
setAddsourcefile in interface ExecuteOn

setCommand

public void setCommand(Commandline cmdl)
Overrides:
setCommand in interface ExecTask

setDefaultexcludes

public void setDefaultexcludes(boolean useDefaultExcludes)
Sets whether default exclusions should be used or not.
Parameters:
useDefaultExcludes - "true"|"on"|"yes" when default exclusions should be used, "false"|"off"|"no" when they shouldn't be used.

setDir

public void setDir(File src)
The directory which holds the files whose permissions must be changed.
Overrides:
setDir in interface ExecTask
Parameters:
src -

setExcludes

public void setExcludes(String excludes)
Sets the set of exclude patterns. Patterns may be separated by a comma or a space.
Parameters:
excludes - the string containing the exclude patterns

setExecutable

public void setExecutable(String e)
Overrides:
setExecutable in interface ExecTask

setFile

public void setFile(File src)
The file or single directory of which the permissions must be changed.
Parameters:
src -

setIncludes

public void setIncludes(String includes)
Sets the set of include patterns. Patterns may be separated by a comma or a space.
Parameters:
includes - the string containing the include patterns

setPerm

public void setPerm(String perm)
The new permissions.
Parameters:
perm -

setProject

public void setProject(Project project)
Overrides:
setProject in interface ProjectComponent

setSkipEmptyFilesets

public void setSkipEmptyFilesets(boolean skip)
Overrides:
setSkipEmptyFilesets in interface ExecuteOn

Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.