If @{remoteDocToPdf}
only carries a filename and not an absolute path, you can remove the spaces in the filename by adding this directive after the one you posted:
<propertyregex override="yes" property="pdf.name" input="${pdf.name}"
regexp=" " replace="" global="true" />
It's not possible to delete the spaces and do the .doc
-> .pdf
transformation in one go, since you can only either specify select
or replace
per <propertyregex...
.
Edit 1: I missed adding global="true"
to the above, so only the first space would have been replaced (according to the documentation, at least).
Edit 2: A note on the <propertyregex...
you've posted - I'm pretty sure that the regular expression \.*([[^/]+$^\.]*)\.doc
is not really what you want, even though it may seem to work as intended. From your comment I'm guessing that all you want to do is replace .doc
with .pdf
. In that case, please use this instead:
<propertyregex override="yes" property="pdf.name" input="@{remoteDocToPdf}"
regexp="\.doc$" replace=".pdf" />
If you'd like to read up on regular expressions, I can recommend reading this tutorial.