Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs.condition

public Class FilesMatch

extends Object
implements Condition
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.taskdefs.condition.Condition
Imports
java.io.File, .IOException, org.apache.tools.ant.BuildException, org.apache.tools.ant.util.FileUtils

Compares two files for equality based on size and content. Timestamps are not at all looked at.
Since
Ant 1.5

Field Summary

Modifier and TypeField and Description
private File
file1

files to compare

private File
file2

files to compare

private static final FileUtils
FILE_UTILS

Helper that provides the file comparison method.

private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the files are equal
eval
()

Implements org.apache.tools.ant.taskdefs.condition.Condition.eval.

comparison method of the interface
public void
setFile1(File
The new File1 value
file1
)

Sets the File1 attribute

public void
setFile2(File
The new File2 value
file2
)

Sets the File2 attribute

public void
setTextfile(boolean
whether to ignore line endings.
textfile
)

Set whether to ignore line endings when comparing files.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

file1back to summary
private File file1

files to compare

file2back to summary
private File file2

files to compare

FILE_UTILSback to summary
private static final FileUtils FILE_UTILS

Helper that provides the file comparison method.

textfileback to summary
private boolean textfile

Constructor Detail

FilesMatchback to summary
public FilesMatch()

Method Detail

evalback to summary
public boolean eval() throws BuildException

Implements org.apache.tools.ant.taskdefs.condition.Condition.eval.

comparison method of the interface

Returns:boolean

true if the files are equal

Annotations
@Override
Exceptions
BuildException:
if it all went pear-shaped
setFile1back to summary
public void setFile1(File file1)

Sets the File1 attribute

Parameters
file1:File

The new File1 value

setFile2back to summary
public void setFile2(File file2)

Sets the File2 attribute

Parameters
file2:File

The new File2 value

setTextfileback to summary
public void setTextfile(boolean textfile)

Set whether to ignore line endings when comparing files.

Parameters
textfile:boolean

whether to ignore line endings.