Selector class that uses Algorithm, Cache and Comparator
for its work.
The Algorithm is used for computing a hashvalue for a file.
The Comparator decides whether to select or not.
The Cache stores the other value for comparison by the Comparator
in a persistent manner.
The ModifiedSelector is implemented as a CoreSelector and uses default
values for all its attributes therefore the simpliest example is
<copy todir="dest">
<filelist dir="src">
<modified/>
</filelist>
</copy>
The same example rewritten as CoreSelector with setting the all values
(same as defaults are) would be
<copy todir="dest">
<filelist dir="src">
<modified update="true"
cache="propertyfile"
algorithm="digest"
comparator="equal">
<param name="cache.cachefile" value="cache.properties"/>
<param name="algorithm.algorithm" value="MD5"/>
</modified>
</filelist>
</copy>
And the same rewritten as CustomSelector would be
<copy todir="dest">
<filelist dir="src">
<custom class="org.apache.tools.ant.type.selectors.ModifiedSelector">
<param name="update" value="true"/>
<param name="cache" value="propertyfile"/>
<param name="algorithm" value="digest"/>
<param name="comparator" value="equal"/>
<param name="cache.cachefile" value="cache.properties"/>
<param name="algorithm.algorithm" value="MD5"/>
</custom>
</filelist>
</copy>
If you want to provide your own interface implementation you can do
that via the *classname attributes. |