Class DifferentSelector
- 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:
- java.lang.Cloneable,- ResourceSelector,- FileSelector
 
 public class DifferentSelector extends MappingSelector 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 descendant routines conditional. 
- 
- 
Field Summary- 
Fields inherited from class org.apache.tools.ant.types.selectors.MappingSelectorgranularity, map, mapperElement, targetdir
 - 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Constructor SummaryConstructors Constructor Description DifferentSelector()
 - 
Method SummaryModifier and Type Method Description protected booleanselectionTest(java.io.File srcfile, java.io.File destfile)this test is our selection test that compared the file with the destfilevoidsetIgnoreContents(boolean ignoreContents)This flag tells the selector to ignore contentsvoidsetIgnoreFileTimes(boolean ignoreFileTimes)This flag tells the selector to ignore file times in the comparison- 
Methods inherited from class org.apache.tools.ant.types.selectors.MappingSelectoraddConfigured, createMapper, isSelected, setGranularity, setTargetdir, verifySettings
 - 
Methods inherited from class org.apache.tools.ant.types.selectors.BaseSelectorgetError, setError, setError, validate
 - 
Methods inherited from class org.apache.tools.ant.types.DataTypecheckAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, setRefid, tooManyAttributes, toString
 - 
Methods inherited from class org.apache.tools.ant.ProjectComponentgetDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
 - 
Methods inherited from class java.lang.Objectequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.apache.tools.ant.types.selectors.FileSelectorisSelected
 
- 
 
- 
- 
- 
Method Detail- 
setIgnoreFileTimespublic void setIgnoreFileTimes(boolean ignoreFileTimes) This flag tells the selector to ignore file times in the comparison- Parameters:
- ignoreFileTimes- if true ignore file times
 
 - 
setIgnoreContentspublic void setIgnoreContents(boolean ignoreContents) This flag tells the selector to ignore contents- Parameters:
- ignoreContents- if true ignore contents
- Since:
- ant 1.6.3
 
 - 
selectionTestprotected boolean selectionTest(java.io.File srcfile, java.io.File destfile)this test is our selection test that compared the file with the destfile- Specified by:
- selectionTestin class- MappingSelector
- Parameters:
- srcfile- the source file
- destfile- the destination file
- Returns:
- true if the files are different
 
 
- 
 
-