Javatpoint Logo
Javatpoint Logo

Apache Ant Basename Task

This task is used to get the basename of a specified file.

It sets specified property to the value of the last path element of the specified file. If the executed file is a directory, the basename will be the last directory element. It returns basename as a simple file name if the file is a full-path or relative-path without any directory elements.

Basename Task Attributes

Attribute Description Required
file The path to take the basename Yes
property The name of the property. Yes
suffix It is a suffix to remove from the resulting basename. No

Apache Ant Basename Task Example

Set Jar to a property by specifying file location.






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA