Process file: // log in Ant script

For some purposes Ant requires the URL to be defined as a property (for example ivy pattern

), and since the protocol file://

is different from Windows ( file:/

either file:///

) and Unix ( file://

), this makes the whole script less portable.

Is there a good way to handle the protocol file

without using Ant properties and conditions?

0


a source to share


2 answers


Finally, I decided to use the Condition task from Ant:



<condition property="file.protocol" value="file:///" else="file://">
    <os family="dos"/>
</condition>

      

0


a source


Usage file:///

should work on both systems. But maybe the PathConvert task can help you here?



+1


a source







All Articles