import-bot (20211) [Avatar] Offline
Why does <filter > task corrupt the binaries?
[Originally posted by ashwinpj]

We have a requirement to change the value of a configuration based on a
property and we used filterset with filter sub element as in the following
code fragment. But when we do this. The classes and jar files in the lib and
classes directory get corrupted. I it so that I filter on that file that has
the token. But was curious as to why does it corrupt the binaries

<copy todir="${dist}/Web Content">
<fileset dir="Web Content"/>
<filter token="is_web_server_env" value="${is_web_server_env}"/>
import-bot (20211) [Avatar] Offline
Re: Why does &lt;filter &gt; task corrupt the binaries?
[Originally posted by erikhatcher]

The task rewrites the output files and in the process replaces string tokens.
Binary files get
mangled, as you've experienced. Use the includes/excludes clauses to skip
binary files and only
process the text files that need filtering.