|
BasenameDescriptionTask to determine the basename of a specified file, optionally minus a specified suffix.
When this task executes, it will set the specified property to the
value of the last path element of the specified file. If
Parameters
Examples<basename property="jar.filename" file="${lib.jarfile}"/>will set jar.filename to
myjar.jar , if lib.jarfile is defined as either a
full-path filename (eg., /usr/local/lib/myjar.jar ),
a relative-path filename (eg., lib/myjar.jar ),
or a simple filename (eg., myjar.jar ).
<basename property="cmdname" file="D:/usr/local/foo.exe" suffix=".exe"/>will set cmdname to foo .
<property environment="env"/> <basename property="temp.dirname" file="${env.TEMP}"/>will set temp.dirname to the last directory element of
the path defined for the TEMP environment variable.
Copyright © 2002 Apache Software Foundation. All rights Reserved. |