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

public Class Date

extends Object
implements ResourceSelector
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.types.resources.selectors.ResourceSelector
Imports
java.text.DateFormat, .ParseException, .SimpleDateFormat, java.util.Locale, org.apache.tools.ant.BuildException, org.apache.tools.ant.types.Resource, .TimeComparison, org.apache.tools.ant.util.FileUtils

Date ResourceSelector. Based on the date FileSelector, with the most notable difference being the lack of support for the includedirs attribute. It is recommended that the effect of includeDirs = "false" be achieved for resources by enclosing a "dir" Type ResourceSelector and a Date ResourceSelector in an Or ResourceSelector.
Since
Ant 1.7

Field Summary

Modifier and TypeField and Description
private String
private static final FileUtils
private long
private Long
private static final String
private String
private TimeComparison

Constructor Summary

AccessConstructor and Description
public
Date()

Method Summary

Modifier and TypeMethod and Description
public synchronized String

Returns:

a String representing a date and time.
getDatetime
()

Get the date and time in String format.

public synchronized long

Returns:

the long granularity.
getGranularity
()

Get the timestamp granularity used by this ResourceSelector.

public synchronized long

Returns:

long number of millis since 1970.
getMillis
()

Get the date/time in ms.

public synchronized String

Returns:

a SimpleDateFormat-compatible pattern string.
getPattern
()

Get the pattern for use with the datetime attribute.

public synchronized TimeComparison

Returns:

a TimeComparison object.
getWhen
()

Get the comparison mode.

public synchronized boolean

Returns:

whether the Resource was selected.
isSelected
(Resource
the Resource to check.
r
)

Implements org.apache.tools.ant.types.resources.selectors.ResourceSelector.isSelected.

Return true if this Resource is selected.
public synchronized void
setDateTime(String
the date and time to use.
s
)

Set the date and time as a String.

public synchronized void
setGranularity(long
the timestamp granularity.
g
)

Set the granularity to use for this ResourceSelector.

public synchronized void
setMillis(long
the number of millis.
m
)

Set the date/time in milliseconds since 1970.

public synchronized void
setPattern(String
the SimpleDateFormat-compatible pattern string.
p
)

Set the optional pattern to use with the datetime attribute.

public synchronized void
setWhen(TimeComparison
a TimeComparison object.
c
)

Set the comparison mode.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dateTimeback to summary
private String dateTime
FILE_UTILSback to summary
private static final FileUtils FILE_UTILS
granularityback to summary
private long granularity
millisback to summary
private Long millis
MILLIS_OR_DATETIMEback to summary
private static final String MILLIS_OR_DATETIME
patternback to summary
private String pattern
whenback to summary
private TimeComparison when

Constructor Detail

Dateback to summary
public Date()

Method Detail

getDatetimeback to summary
public synchronized String getDatetime()

Get the date and time in String format.

Returns:String

a String representing a date and time.

getGranularityback to summary
public synchronized long getGranularity()

Get the timestamp granularity used by this ResourceSelector.

Returns:long

the long granularity.

getMillisback to summary
public synchronized long getMillis()

Get the date/time in ms.

Returns:long

long number of millis since 1970.

getPatternback to summary
public synchronized String getPattern()

Get the pattern for use with the datetime attribute.

Returns:String

a SimpleDateFormat-compatible pattern string.

getWhenback to summary
public synchronized TimeComparison getWhen()

Get the comparison mode.

Returns:TimeComparison

a TimeComparison object.

isSelectedback to summary
public synchronized boolean isSelected(Resource r)

Implements org.apache.tools.ant.types.resources.selectors.ResourceSelector.isSelected.

Return true if this Resource is selected.

Parameters
r:Resource

the Resource to check.

Returns:boolean

whether the Resource was selected.

setDateTimeback to summary
public synchronized void setDateTime(String s)

Set the date and time as a String.

Parameters
s:String

the date and time to use.

setGranularityback to summary
public synchronized void setGranularity(long g)

Set the granularity to use for this ResourceSelector.

Parameters
g:long

the timestamp granularity.

setMillisback to summary
public synchronized void setMillis(long m)

Set the date/time in milliseconds since 1970.

Parameters
m:long

the number of millis.

setPatternback to summary
public synchronized void setPattern(String p)

Set the optional pattern to use with the datetime attribute.

Parameters
p:String

the SimpleDateFormat-compatible pattern string.

setWhenback to summary
public synchronized void setWhen(TimeComparison c)

Set the comparison mode.

Parameters
c:TimeComparison

a TimeComparison object.