Package org.apache.tools.ant.taskdefs
Class Basename
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.Basename
- All Implemented Interfaces:
- Cloneable
Sets a property to the base name of a specified file, optionally minus a
 suffix.
 This task can accept the following attributes:
 
- file
- property
- suffix
When this task executes, it will set the specified property to the value of the last element in the specified file. If file is a directory, the basename will be the last directory element. If file is a full-path filename, the basename will be the simple file name. If a suffix is specified, and the specified file ends in that suffix, the basename will be the simple file name without the suffix.
- Since:
- Ant 1.5
- 
Field SummaryFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryMethods inherited from class org.apache.tools.ant.TaskbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
- 
Constructor Details- 
Basenamepublic Basename()
 
- 
- 
Method Details- 
setFilefile or directory to get base name from- Parameters:
- file- file or directory to get base name from
 
- 
setPropertyProperty to set base name to.- Parameters:
- property- name of property
 
- 
setSuffixOptional suffix to remove from base name.- Parameters:
- suffix- suffix to remove from base name
 
- 
executedo the work- Overrides:
- executein class- Task
- Throws:
- BuildException- if required attributes are not supplied property and attribute are required attributes
 
 
-