Friday 29 September 2017

ANT : Get File Directory and File Name from Path

This is what you should do if you are trying to get ANT to get;

1. File name with directory path from a location

Use the below code snippet in your build.xml

                      <path id="filewithpath">
                            <fileset dir="${location}">
                                <include name="*_myfile_*.xml"/>
                            </fileset>
                        </path>

${filewithpath} should evaluate as the file name with full directory path.

2. Only File name from a location

                      <path id="filewithpath">
                            <fileset dir="${location}">
                                <include name="*_myfile_*.xml"/>
                            </fileset>
                        </path>

                  <pathconvert property="filename" refid="filewithpath"/>

${filename} should evaluate as the file name.


Helpful? Please comment.

Happy Learning!!





No comments:

Post a Comment

OSB 12c : Dynamic Routing to Business/Proxy Service

Dynamic routing is a kind of  Content-based Routing pattern, which is used when the BusinessService/ProxyService path is required to be de...