FileDocCategorySizeDatePackage
Content.javaAPI DocApache Ant 1.702423Wed Dec 13 06:16:24 GMT 2006org.apache.tools.ant.types.resources.comparators

Content

public class Content extends ResourceComparator
Compares Resources by content.
since
Ant 1.7

Fields Summary
private boolean
binary
Constructors Summary
Methods Summary
public booleanisBinary()
Learn whether this Content ResourceComparator is operating in binary mode.

return
boolean binary flag.

        return binary;
    
protected intresourceCompare(org.apache.tools.ant.types.Resource foo, org.apache.tools.ant.types.Resource bar)
Compare two Resources by content.

param
foo the first Resource.
param
bar the second Resource.
return
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
throws
BuildException if I/O errors occur.
see
org.apache.tools.ant.util.ResourceUtils#compareContent(Resource, Resource, boolean).

        try {
            return ResourceUtils.compareContent(foo, bar, !binary);
        } catch (IOException e) {
            throw new BuildException(e);
        }
    
public voidsetBinary(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.

param
b whether to compare content in binary mode.


                                            
        
        binary = b;