Save This Page
Home » apache-ant-1.8.1 » org.apache.tools » ant » types » selectors » [javadoc | source]
org.apache.tools.ant.types.selectors
public class: DifferentSelector [javadoc | source]
java.lang.Object
   org.apache.tools.ant.ProjectComponent
      org.apache.tools.ant.types.DataType
         org.apache.tools.ant.types.selectors.BaseSelector
            org.apache.tools.ant.types.selectors.MappingSelector
               org.apache.tools.ant.types.selectors.DifferentSelector

All Implemented Interfaces:
    FileSelector, Cloneable

This selector selects files against a mapped set of target files, selecting all those files which are different. Files with different lengths are deemed different automatically Files with identical timestamps are viewed as matching by default, unless you specify otherwise. Contents are compared if the lengths are the same and the timestamps are ignored or the same, except if you decide to ignore contents to gain speed.

This is a useful selector to work with programs and tasks that don't handle dependency checking properly; Even if a predecessor task always creates its output files, followup tasks can be driven off copies made with a different selector, so their dependencies are driven on the absolute state of the files, not a timestamp.

Clearly, however, bulk file comparisons is inefficient; anything that can use timestamps is to be preferred. If this selector must be used, use it over as few files as possible, perhaps following it with an <uptodate;> to keep the descendent routines conditional.
Fields inherited from org.apache.tools.ant.types.selectors.MappingSelector:
targetdir,  mapperElement,  map,  granularity
Fields inherited from org.apache.tools.ant.types.DataType:
ref,  checked
Fields inherited from org.apache.tools.ant.ProjectComponent:
project,  location,  description
Method from org.apache.tools.ant.types.selectors.DifferentSelector Summary:
selectionTest,   setIgnoreContents,   setIgnoreFileTimes
Methods from org.apache.tools.ant.types.selectors.MappingSelector:
addConfigured,   createMapper,   isSelected,   selectionTest,   setGranularity,   setTargetdir,   verifySettings
Methods from org.apache.tools.ant.types.selectors.BaseSelector:
getError,   isSelected,   setError,   validate,   verifySettings
Methods from org.apache.tools.ant.types.DataType:
checkAttributesAllowed,   checkChildrenAllowed,   circularReference,   clone,   dieOnCircularReference,   dieOnCircularReference,   dieOnCircularReference,   getCheckedRef,   getCheckedRef,   getCheckedRef,   getCheckedRef,   getDataTypeName,   getRefid,   invokeCircularReferenceCheck,   isChecked,   isReference,   noChildrenAllowed,   pushAndInvokeCircularReferenceCheck,   setChecked,   setRefid,   toString,   tooManyAttributes
Methods from org.apache.tools.ant.ProjectComponent:
clone,   getDescription,   getLocation,   getProject,   log,   log,   setDescription,   setLocation,   setProject
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tools.ant.types.selectors.DifferentSelector Detail:
 protected boolean selectionTest(File srcfile,
    File destfile) 
    this test is our selection test that compared the file with the destfile
 public  void setIgnoreContents(boolean ignoreContents) 
    This flag tells the selector to ignore contents
 public  void setIgnoreFileTimes(boolean ignoreFileTimes) 
    This flag tells the selector to ignore file times in the comparison