org.apache.tools.ant.taskdefs.condition

Class IsLastModified

public class IsLastModified extends ProjectComponent implements Condition

Condition that makes assertions about the last modified date of a resource.

Since: Ant 1.8.0

Nested Class Summary
static classIsLastModified.CompareMode
Method Summary
voidadd(Resource r)
The resource to test.
booleaneval()
protected longgetMillis()
Calculate timestamp as millis either based on millis or dateTime (and pattern) attribute.
voidsetDatetime(String dateTime)
Set the new modification time of file(s) touched in the format "MM/DD/YYYY HH:MM AM or PM" or "MM/DD/YYYY HH:MM:SS AM or PM".
voidsetMillis(long millis)
Set the new modification time of file(s) touched in milliseconds since midnight Jan 1 1970.
voidsetMode(IsLastModified.CompareMode mode)
The type of comparison to test.
voidsetPattern(String pattern)
Set the format of the datetime attribute.
protected voidvalidate()
Argument validation.

Method Detail

add

public void add(Resource r)
The resource to test.

eval

public boolean eval()

getMillis

protected long getMillis()
Calculate timestamp as millis either based on millis or dateTime (and pattern) attribute.

setDatetime

public void setDatetime(String dateTime)
Set the new modification time of file(s) touched in the format "MM/DD/YYYY HH:MM AM or PM" or "MM/DD/YYYY HH:MM:SS AM or PM".

Parameters: dateTime the String date in the specified format.

setMillis

public void setMillis(long millis)
Set the new modification time of file(s) touched in milliseconds since midnight Jan 1 1970.

Parameters: millis the long timestamp to use.

setMode

public void setMode(IsLastModified.CompareMode mode)
The type of comparison to test.

setPattern

public void setPattern(String pattern)
Set the format of the datetime attribute.

Parameters: pattern the SimpleDateFormat-compatible format pattern.

validate

protected void validate()
Argument validation.