Top Description Fields Constructors Methods
org.apache.tools.ant.types.resources.comparators

public Class Content

extends ResourceComparator
Class Inheritance
Imports
java.io.IOException, org.apache.tools.ant.BuildException, org.apache.tools.ant.types.Resource, org.apache.tools.ant.util.ResourceUtils

Compares Resources by content.
Since
Ant 1.7

Field Summary

Modifier and TypeField and Description
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

boolean binary flag.
isBinary
()

Learn whether this Content ResourceComparator is operating in binary mode.

protected int

Returns:

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
resourceCompare
(Resource
the first Resource.
foo
,
Resource
the second Resource.
bar
)

Implements abstract org.apache.tools.ant.types.resources.comparators.ResourceComparator.resourceCompare.

Compare two Resources by content.
public void
setBinary(boolean
whether to compare content in binary mode.
b
)

Set binary mode for this Content ResourceComparator.

Inherited from org.apache.tools.ant.types.resources.comparators.ResourceComparator:
compareequalshashCode

Field Detail

binaryback to summary
private boolean binary

Constructor Detail

Contentback to summary
public Content()

Method Detail

isBinaryback to summary
public boolean isBinary()

Learn whether this Content ResourceComparator is operating in binary mode.

Returns:boolean

boolean binary flag.

resourceCompareback to summary
protected int resourceCompare(Resource foo, Resource bar)

Implements abstract org.apache.tools.ant.types.resources.comparators.ResourceComparator.resourceCompare.

Compare two Resources by content.

Parameters
foo:Resource

the first Resource.

bar:Resource

the second Resource.

Returns:int

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Exceptions
BuildException:
if I/O errors occur.
See Also
org.apache.tools.ant.util.ResourceUtils#compareContent(Resource, Resource, boolean)
setBinaryback to summary
public void setBinary(boolean b)

Set binary mode for this Content ResourceComparator. If this attribute is set to false, Resource content will be compared ignoring platform line-ending conventions. Default is true.

Parameters
b:boolean

whether to compare content in binary mode.